testsuite: Add one more test for _get_comp_words_by_ref()
This test exposes bug in __get_cword_at_cursor_by_ref().
This commit is contained in:
parent
d48d9ebd2f
commit
588facb6b6
@ -115,6 +115,14 @@ assert_bash_list {"b\\ c a"} $cmd $test
|
|||||||
sync_after_int
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
set test {a\ b a\ b| should return a\ b}; # | = cursor position
|
||||||
|
set cmd {COMP_WORDS=('a\ b' 'a\ b'); COMP_CWORD=1; COMP_LINE='a\ b a\ b'; COMP_POINT=11; _get_comp_words_by_ref cur prev; echo "$cur $prev"}
|
||||||
|
assert_bash_list {"a\\ b a\\ b"} $cmd $test
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
set test {a b\| c should return b\ }; # | = cursor position
|
set test {a b\| c should return b\ }; # | = cursor position
|
||||||
set cmd {COMP_WORDS=(a 'b\ c'); COMP_CWORD=1; COMP_LINE='a b\ c'; COMP_POINT=4; _get_comp_words_by_ref cur prev; echo "$cur $prev"}
|
set cmd {COMP_WORDS=(a 'b\ c'); COMP_CWORD=1; COMP_LINE='a b\ c'; COMP_POINT=4; _get_comp_words_by_ref cur prev; echo "$cur $prev"}
|
||||||
assert_bash_list {"b\\ a"} $cmd $test
|
assert_bash_list {"b\\ a"} $cmd $test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user