mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
Merge pull request #5718 from epage/test-split
test(complete): Run completion tests in parallel
This commit is contained in:
commit
31a4450068
4 changed files with 53 additions and 5 deletions
|
@ -240,7 +240,7 @@ fn register_dynamic_env() {
|
|||
|
||||
#[test]
|
||||
#[cfg(all(unix, feature = "unstable-dynamic"))]
|
||||
fn complete_dynamic_env() {
|
||||
fn complete_dynamic_env_toplevel() {
|
||||
if !common::has_command("bash") {
|
||||
return;
|
||||
}
|
||||
|
@ -257,6 +257,18 @@ fn complete_dynamic_env() {
|
|||
"#]];
|
||||
let actual = runtime.complete(input, &term).unwrap();
|
||||
assert_data_eq!(actual, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(all(unix, feature = "unstable-dynamic"))]
|
||||
fn complete_dynamic_env_quoted_help() {
|
||||
if !common::has_command("bash") {
|
||||
return;
|
||||
}
|
||||
|
||||
let term = completest::Term::new();
|
||||
let mut runtime =
|
||||
common::load_runtime::<completest_pty::BashRuntimeBuilder>("dynamic-env", "exhaustive");
|
||||
|
||||
let input = "exhaustive quote \t\t";
|
||||
let expected = snapbox::str![[r#"
|
||||
|
|
|
@ -142,7 +142,7 @@ fn register_completion() {
|
|||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
fn complete() {
|
||||
fn complete_static_toplevel() {
|
||||
if !common::has_command("elvish") {
|
||||
return;
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ fn register_dynamic_env() {
|
|||
|
||||
#[test]
|
||||
#[cfg(all(unix, feature = "unstable-dynamic"))]
|
||||
fn complete_dynamic_env() {
|
||||
fn complete_dynamic_env_toplevel() {
|
||||
if !common::has_command("elvish") {
|
||||
return;
|
||||
}
|
||||
|
@ -200,6 +200,18 @@ fn complete_dynamic_env() {
|
|||
"#]];
|
||||
let actual = runtime.complete(input, &term).unwrap();
|
||||
assert_data_eq!(actual, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(all(unix, feature = "unstable-dynamic"))]
|
||||
fn complete_dynamic_env_quoted_help() {
|
||||
if !common::has_command("elvish") {
|
||||
return;
|
||||
}
|
||||
|
||||
let term = completest::Term::new();
|
||||
let mut runtime =
|
||||
common::load_runtime::<completest_pty::ElvishRuntimeBuilder>("dynamic-env", "exhaustive");
|
||||
|
||||
let input = "exhaustive quote \t";
|
||||
let expected = snapbox::str![[r#"
|
||||
|
|
|
@ -177,7 +177,7 @@ fn register_dynamic_env() {
|
|||
|
||||
#[test]
|
||||
#[cfg(all(unix, feature = "unstable-dynamic"))]
|
||||
fn complete_dynamic_env() {
|
||||
fn complete_dynamic_env_toplevel() {
|
||||
if !common::has_command("fish") {
|
||||
return;
|
||||
}
|
||||
|
@ -197,6 +197,18 @@ last -V (Print ve
|
|||
"#]];
|
||||
let actual = runtime.complete(input, &term).unwrap();
|
||||
assert_data_eq!(actual, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(all(unix, feature = "unstable-dynamic"))]
|
||||
fn complete_dynamic_env_quoted_help() {
|
||||
if !common::has_command("fish") {
|
||||
return;
|
||||
}
|
||||
|
||||
let term = completest::Term::new();
|
||||
let mut runtime =
|
||||
common::load_runtime::<completest_pty::FishRuntimeBuilder>("dynamic-env", "exhaustive");
|
||||
|
||||
let input = "exhaustive quote \t\t";
|
||||
let expected = snapbox::str![[r#"
|
||||
|
|
|
@ -170,7 +170,7 @@ fn register_dynamic_env() {
|
|||
|
||||
#[test]
|
||||
#[cfg(all(unix, feature = "unstable-dynamic"))]
|
||||
fn complete_dynamic_env() {
|
||||
fn complete_dynamic_env_toplevel() {
|
||||
if !common::has_command("zsh") {
|
||||
return;
|
||||
}
|
||||
|
@ -187,6 +187,18 @@ fn complete_dynamic_env() {
|
|||
"#]];
|
||||
let actual = runtime.complete(input, &term).unwrap();
|
||||
assert_data_eq!(actual, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(all(unix, feature = "unstable-dynamic"))]
|
||||
fn complete_dynamic_env_quoted_help() {
|
||||
if !common::has_command("zsh") {
|
||||
return;
|
||||
}
|
||||
|
||||
let term = completest::Term::new();
|
||||
let mut runtime =
|
||||
common::load_runtime::<completest_pty::ZshRuntimeBuilder>("dynamic-env", "exhaustive");
|
||||
|
||||
let input = "exhaustive quote \t\t";
|
||||
let expected = snapbox::str![[r#"
|
||||
|
|
Loading…
Reference in a new issue