@@ -760,17 +760,13 @@ fn dotnu_completions_const_nu_lib_dirs() {
760760}
761761
762762#[ test]
763- #[ ignore]
764763fn external_completer_trailing_space ( ) {
765764 // https://github.com/nushell/nushell/issues/6378
766765 let block = "{|spans| $spans}" ;
767766 let input = "gh alias " ;
768767
769768 let suggestions = run_external_completion ( block, input) ;
770- assert_eq ! ( 3 , suggestions. len( ) ) ;
771- assert_eq ! ( "gh" , suggestions. first( ) . unwrap( ) . value) ;
772- assert_eq ! ( "alias" , suggestions. get( 1 ) . unwrap( ) . value) ;
773- assert_eq ! ( "" , suggestions. get( 2 ) . unwrap( ) . value) ;
769+ match_suggestions ( & vec ! [ "gh" , "alias" , "" ] , & suggestions) ;
774770}
775771
776772#[ test]
@@ -2640,7 +2636,6 @@ fn exact_match_case_insensitive() {
26402636 } ) ;
26412637}
26422638
2643- #[ ignore = "was reverted, still needs fixing" ]
26442639#[ rstest]
26452640fn alias_offset_bug_7648 ( ) {
26462641 let ( _, _, mut engine, mut stack) = new_engine ( ) ;
@@ -2650,16 +2645,15 @@ fn alias_offset_bug_7648() {
26502645 assert ! ( support:: merge_input( alias. as_bytes( ) , & mut engine, & mut stack) . is_ok( ) ) ;
26512646
26522647 let mut completer = NuCompleter :: new ( Arc :: new ( engine) , Arc :: new ( stack) ) ;
2648+ let suggestions = completer. complete ( "e" , 1 ) ;
2649+ assert ! ( !suggestions. is_empty( ) ) ;
26532650
2654- // Issue #7648
2655- // Nushell crashes when an alias name is shorter than the alias command
2656- // and the alias command is a external command
2657- // This happens because of offset is not correct.
2658- // This crashes before PR #7779
2659- let _suggestions = completer. complete ( "e" , 1 ) ;
2651+ // Make sure completion in complicated external head expression still works
2652+ let input = "^(ls | e" ;
2653+ let suggestions = completer. complete ( input, input. len ( ) ) ;
2654+ assert ! ( !suggestions. is_empty( ) ) ;
26602655}
26612656
2662- #[ ignore = "was reverted, still needs fixing" ]
26632657#[ rstest]
26642658fn alias_offset_bug_7754 ( ) {
26652659 let ( _, _, mut engine, mut stack) = new_engine ( ) ;
@@ -2669,12 +2663,8 @@ fn alias_offset_bug_7754() {
26692663 assert ! ( support:: merge_input( alias. as_bytes( ) , & mut engine, & mut stack) . is_ok( ) ) ;
26702664
26712665 let mut completer = NuCompleter :: new ( Arc :: new ( engine) , Arc :: new ( stack) ) ;
2672-
2673- // Issue #7754
2674- // Nushell crashes when an alias name is shorter than the alias command
2675- // and the alias command contains pipes.
2676- // This crashes before PR #7756
2677- let _suggestions = completer. complete ( "ll -a | c" , 9 ) ;
2666+ let suggestions = completer. complete ( "ll -a | c" , 9 ) ;
2667+ assert ! ( !suggestions. is_empty( ) ) ;
26782668}
26792669
26802670#[ rstest]
0 commit comments