diff --git a/clap_complete/tests/testsuite/dynamic.rs b/clap_complete/tests/testsuite/dynamic.rs index 7087a8e0..0ff3aba1 100644 --- a/clap_complete/tests/testsuite/dynamic.rs +++ b/clap_complete/tests/testsuite/dynamic.rs @@ -402,6 +402,56 @@ pos_b pos_c" ] ); + + assert_data_eq!( + complete!(cmd, "-ci[TAB]", current_dir = Some(testdir_path)), + snapbox::str![ + "-cii +-ciF +-cic +-cih Print help" + ] + ); + + assert_data_eq!( + complete!(cmd, "-ci=[TAB]", current_dir = Some(testdir_path)), + snapbox::str![ + "-ci=i +-ci=F +-ci=c +-ci=h Print help" + ] + ); + + assert_data_eq!( + complete!(cmd, "-ci=a[TAB]", current_dir = Some(testdir_path)), + snapbox::str![ + "-ci=ai +-ci=aF +-ci=ac +-ci=ah Print help" + ] + ); + + assert_data_eq!( + complete!(cmd, "-ciF[TAB]", current_dir = Some(testdir_path)), + snapbox::str![ + "-ciFi +-ciFF +-ciFc +-ciFh\tPrint help" + ] + ); + + assert_data_eq!( + complete!(cmd, "-ciF=[TAB]", current_dir = Some(testdir_path)), + snapbox::str![ + "-ciF=i +-ciF=F +-ciF=c +-ciF=h\tPrint help" + ] + ) } fn complete(cmd: &mut Command, args: impl AsRef, current_dir: Option<&Path>) -> String {