Skip to content

Commit 94f3378

Browse files
committed
test(complete): Test option completion with tags
1 parent 1420275 commit 94f3378

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

  • clap_complete/tests/testsuite

clap_complete/tests/testsuite/zsh.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,3 +435,30 @@ tests/examples.rs tests/snapshots tests/testsuite
435435
let actual = runtime.complete(input, &term).unwrap();
436436
assert_data_eq!(actual, expected);
437437
}
438+
439+
#[test]
440+
#[cfg(all(unix, feature = "unstable-dynamic"))]
441+
#[cfg(feature = "unstable-shell-tests")]
442+
fn complete_dynamic_tagged_options() {
443+
if !common::has_command(CMD) {
444+
return;
445+
}
446+
447+
let term = completest::Term::new();
448+
let mut runtime = common::load_runtime::<RuntimeBuilder>("dynamic-env", "exhaustive");
449+
450+
let input = [
451+
"zstyle ':completion:*:descriptions' format '%d'",
452+
"exhaustive -\t\t",
453+
].join("\n");
454+
455+
let expected = snapbox::str![[r#"
456+
% zstyle ':completion:*:descriptions' format '%d'
457+
% exhaustive -
458+
--generate -- generate
459+
-h -- Print help
460+
--empty-choice
461+
"#]];
462+
let actual = runtime.complete(&input, &term).unwrap();
463+
assert_data_eq!(actual, expected);
464+
}

0 commit comments

Comments
 (0)