Merge pull request #5718 from epage/test-split

test(complete): Run completion tests in parallel
This commit is contained in:
Ed Page 2024-09-04 12:40:42 -05:00 committed by GitHub
commit 31a4450068
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 53 additions and 5 deletions

View file

@ -240,7 +240,7 @@ fn register_dynamic_env() {
#[test] #[test]
#[cfg(all(unix, feature = "unstable-dynamic"))] #[cfg(all(unix, feature = "unstable-dynamic"))]
fn complete_dynamic_env() { fn complete_dynamic_env_toplevel() {
if !common::has_command("bash") { if !common::has_command("bash") {
return; return;
} }
@ -257,6 +257,18 @@ fn complete_dynamic_env() {
"#]]; "#]];
let actual = runtime.complete(input, &term).unwrap(); let actual = runtime.complete(input, &term).unwrap();
assert_data_eq!(actual, expected); 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 input = "exhaustive quote \t\t";
let expected = snapbox::str![[r#" let expected = snapbox::str![[r#"

View file

@ -142,7 +142,7 @@ fn register_completion() {
#[test] #[test]
#[cfg(unix)] #[cfg(unix)]
fn complete() { fn complete_static_toplevel() {
if !common::has_command("elvish") { if !common::has_command("elvish") {
return; return;
} }
@ -182,7 +182,7 @@ fn register_dynamic_env() {
#[test] #[test]
#[cfg(all(unix, feature = "unstable-dynamic"))] #[cfg(all(unix, feature = "unstable-dynamic"))]
fn complete_dynamic_env() { fn complete_dynamic_env_toplevel() {
if !common::has_command("elvish") { if !common::has_command("elvish") {
return; return;
} }
@ -200,6 +200,18 @@ fn complete_dynamic_env() {
"#]]; "#]];
let actual = runtime.complete(input, &term).unwrap(); let actual = runtime.complete(input, &term).unwrap();
assert_data_eq!(actual, expected); 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 input = "exhaustive quote \t";
let expected = snapbox::str![[r#" let expected = snapbox::str![[r#"

View file

@ -177,7 +177,7 @@ fn register_dynamic_env() {
#[test] #[test]
#[cfg(all(unix, feature = "unstable-dynamic"))] #[cfg(all(unix, feature = "unstable-dynamic"))]
fn complete_dynamic_env() { fn complete_dynamic_env_toplevel() {
if !common::has_command("fish") { if !common::has_command("fish") {
return; return;
} }
@ -197,6 +197,18 @@ last -V (Print ve
"#]]; "#]];
let actual = runtime.complete(input, &term).unwrap(); let actual = runtime.complete(input, &term).unwrap();
assert_data_eq!(actual, expected); 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 input = "exhaustive quote \t\t";
let expected = snapbox::str![[r#" let expected = snapbox::str![[r#"

View file

@ -170,7 +170,7 @@ fn register_dynamic_env() {
#[test] #[test]
#[cfg(all(unix, feature = "unstable-dynamic"))] #[cfg(all(unix, feature = "unstable-dynamic"))]
fn complete_dynamic_env() { fn complete_dynamic_env_toplevel() {
if !common::has_command("zsh") { if !common::has_command("zsh") {
return; return;
} }
@ -187,6 +187,18 @@ fn complete_dynamic_env() {
"#]]; "#]];
let actual = runtime.complete(input, &term).unwrap(); let actual = runtime.complete(input, &term).unwrap();
assert_data_eq!(actual, expected); 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 input = "exhaustive quote \t\t";
let expected = snapbox::str![[r#" let expected = snapbox::str![[r#"