Skip to content

Commit 2f6a108

Browse files
committed
test(complete): Demonstrate current behavior
1 parent f88be57 commit 2f6a108

File tree

1 file changed

+17
-0
lines changed
  • clap_complete/tests/testsuite

1 file changed

+17
-0
lines changed

clap_complete/tests/testsuite/bash.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,3 +380,20 @@ fn complete_dynamic_empty_option_value() {
380380
let actual = runtime.complete(input, &term).unwrap();
381381
assert_data_eq!(actual, expected);
382382
}
383+
384+
#[test]
385+
#[cfg(all(unix, feature = "unstable-dynamic"))]
386+
#[cfg(feature = "unstable-shell-tests")]
387+
fn complete_dynamic_dir_trailing_space() {
388+
if !common::has_command(CMD) {
389+
return;
390+
}
391+
392+
let term = completest::Term::new();
393+
let mut runtime = common::load_runtime::<RuntimeBuilder>("dynamic-env", "exhaustive");
394+
395+
let input = "exhaustive hint --file test\t";
396+
let expected = snapbox::str!["exhaustive hint --file test % exhaustive hint --file tests/ "];
397+
let actual = runtime.complete(input, &term).unwrap();
398+
assert_data_eq!(actual, expected);
399+
}

0 commit comments

Comments
 (0)