testsuite: Add some failing _get_comp_words_by_ref testcases when cursor is before first word.

This commit is contained in:
Ville Skyttä 2011-05-01 17:33:24 +03:00
parent 5c98d3160a
commit 41ce815827

View File

@ -48,6 +48,22 @@ assert_bash_list {" a"} $cmd $test
sync_after_int sync_after_int
set test "|a "; # | = cursor position
set cmd {COMP_WORDS=(a); COMP_CWORD=0; COMP_LINE='a '; COMP_POINT=0; _get_comp_words_by_ref cur prev; echo "$cur $prev"}
assert_bash_list {" "} $cmd $test
sync_after_int
set test " | a "; # | = cursor position
set cmd {COMP_WORDS=(a); COMP_CWORD=0; COMP_LINE=' a '; COMP_POINT=1; _get_comp_words_by_ref cur prev; echo "$cur $prev"}
assert_bash_list {" "} $cmd $test
sync_after_int
set test "a b |"; # | = cursor position set test "a b |"; # | = cursor position
set cmd {COMP_WORDS=(a b ''); COMP_CWORD=2; COMP_LINE='a b '; COMP_POINT=4; _get_comp_words_by_ref cur prev; echo "$cur $prev"} set cmd {COMP_WORDS=(a b ''); COMP_CWORD=2; COMP_LINE='a b '; COMP_POINT=4; _get_comp_words_by_ref cur prev; echo "$cur $prev"}
assert_bash_list {" b"} $cmd $test assert_bash_list {" b"} $cmd $test