diff --git a/test/unit/_get_comp_words_by_ref.exp b/test/unit/_get_comp_words_by_ref.exp index df2c531d..ad07a659 100644 --- a/test/unit/_get_comp_words_by_ref.exp +++ b/test/unit/_get_comp_words_by_ref.exp @@ -72,6 +72,14 @@ assert_bash_list {"b a"} $cmd $test sync_after_int +set test "a | b"; # | = cursor position +set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=2; _get_comp_words_by_ref cur prev; echo "$cur $prev"} +assert_bash_list {" a"} $cmd $test + + +sync_after_int + + set test {a b\ c| should return b\ c}; # | = cursor position set cmd {COMP_WORDS=(a 'b\ c'); COMP_CWORD=1; COMP_LINE='a b\ c'; COMP_POINT=6; _get_comp_words_by_ref cur prev; echo "$cur $prev"} assert_bash_list {"b\\ c a"} $cmd $test