@@ -506,9 +506,13 @@ fn suggest_value_hint_file_path() {
506506 let testdir_path = testdir. path ( ) . unwrap ( ) ;
507507
508508 fs:: write ( testdir_path. join ( "a_file" ) , "" ) . unwrap ( ) ;
509+ fs:: write ( testdir_path. join ( ".a_file" ) , "" ) . unwrap ( ) ;
509510 fs:: write ( testdir_path. join ( "b_file" ) , "" ) . unwrap ( ) ;
511+ fs:: write ( testdir_path. join ( ".b_file" ) , "" ) . unwrap ( ) ;
510512 fs:: create_dir_all ( testdir_path. join ( "c_dir" ) ) . unwrap ( ) ;
513+ fs:: create_dir_all ( testdir_path. join ( ".c_dir" ) ) . unwrap ( ) ;
511514 fs:: create_dir_all ( testdir_path. join ( "d_dir" ) ) . unwrap ( ) ;
515+ fs:: create_dir_all ( testdir_path. join ( ".d_dir" ) ) . unwrap ( ) ;
512516
513517 assert_data_eq ! (
514518 complete!( cmd, "--input [TAB]" , current_dir = Some ( testdir_path) ) ,
@@ -524,16 +528,34 @@ d_dir/
524528 complete!( cmd, "--input a[TAB]" , current_dir = Some ( testdir_path) ) ,
525529 snapbox:: str ![ "a_file" ] ,
526530 ) ;
531+ assert_data_eq ! (
532+ complete!( cmd, "--input .[TAB]" , current_dir = Some ( testdir_path) ) ,
533+ snapbox:: str ![ [ r#"
534+ ./a_file
535+ ./b_file
536+ ./c_dir/
537+ ./d_dir/
538+ "# ] ] ,
539+ ) ;
540+ assert_data_eq ! (
541+ complete!( cmd, "--input .a[TAB]" , current_dir = Some ( testdir_path) ) ,
542+ snapbox:: str ![ ".a_file" ] ,
543+ ) ;
527544}
528545
529546#[ test]
530547fn suggest_value_path_file ( ) {
531548 let testdir = snapbox:: dir:: DirRoot :: mutable_temp ( ) . unwrap ( ) ;
532549 let testdir_path = testdir. path ( ) . unwrap ( ) ;
550+
533551 fs:: write ( testdir_path. join ( "a_file" ) , "" ) . unwrap ( ) ;
552+ fs:: write ( testdir_path. join ( ".a_file" ) , "" ) . unwrap ( ) ;
534553 fs:: write ( testdir_path. join ( "b_file" ) , "" ) . unwrap ( ) ;
554+ fs:: write ( testdir_path. join ( ".b_file" ) , "" ) . unwrap ( ) ;
535555 fs:: create_dir_all ( testdir_path. join ( "c_dir" ) ) . unwrap ( ) ;
556+ fs:: create_dir_all ( testdir_path. join ( ".c_dir" ) ) . unwrap ( ) ;
536557 fs:: create_dir_all ( testdir_path. join ( "d_dir" ) ) . unwrap ( ) ;
558+ fs:: create_dir_all ( testdir_path. join ( ".d_dir" ) ) . unwrap ( ) ;
537559
538560 let mut cmd = Command :: new ( "dynamic" )
539561 . arg (
@@ -563,16 +585,34 @@ d_dir/
563585 complete!( cmd, "--input a[TAB]" , current_dir = Some ( testdir_path) ) ,
564586 snapbox:: str ![ "a_file" ] ,
565587 ) ;
588+ assert_data_eq ! (
589+ complete!( cmd, "--input .[TAB]" , current_dir = Some ( testdir_path) ) ,
590+ snapbox:: str ![ [ r#"
591+ ./a_file
592+ ./b_file
593+ ./c_dir/
594+ ./d_dir/
595+ "# ] ] ,
596+ ) ;
597+ assert_data_eq ! (
598+ complete!( cmd, "--input .a[TAB]" , current_dir = Some ( testdir_path) ) ,
599+ snapbox:: str ![ ".a_file" ] ,
600+ ) ;
566601}
567602
568603#[ test]
569604fn suggest_value_path_dir ( ) {
570605 let testdir = snapbox:: dir:: DirRoot :: mutable_temp ( ) . unwrap ( ) ;
571606 let testdir_path = testdir. path ( ) . unwrap ( ) ;
607+
572608 fs:: write ( testdir_path. join ( "a_file" ) , "" ) . unwrap ( ) ;
609+ fs:: write ( testdir_path. join ( ".a_file" ) , "" ) . unwrap ( ) ;
573610 fs:: write ( testdir_path. join ( "b_file" ) , "" ) . unwrap ( ) ;
611+ fs:: write ( testdir_path. join ( ".b_file" ) , "" ) . unwrap ( ) ;
574612 fs:: create_dir_all ( testdir_path. join ( "c_dir" ) ) . unwrap ( ) ;
613+ fs:: create_dir_all ( testdir_path. join ( ".c_dir" ) ) . unwrap ( ) ;
575614 fs:: create_dir_all ( testdir_path. join ( "d_dir" ) ) . unwrap ( ) ;
615+ fs:: create_dir_all ( testdir_path. join ( ".d_dir" ) ) . unwrap ( ) ;
576616
577617 let mut cmd = Command :: new ( "dynamic" )
578618 . arg (
@@ -598,6 +638,17 @@ d_dir/
598638 complete!( cmd, "--input c[TAB]" , current_dir = Some ( testdir_path) ) ,
599639 snapbox:: str ![ "c_dir/" ] ,
600640 ) ;
641+ assert_data_eq ! (
642+ complete!( cmd, "--input .[TAB]" , current_dir = Some ( testdir_path) ) ,
643+ snapbox:: str ![ [ r#"
644+ ./c_dir/
645+ ./d_dir/
646+ "# ] ] ,
647+ ) ;
648+ assert_data_eq ! (
649+ complete!( cmd, "--input .c[TAB]" , current_dir = Some ( testdir_path) ) ,
650+ snapbox:: str ![ ".c_dir/" ] ,
651+ ) ;
601652}
602653
603654#[ test]
0 commit comments