summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/unit/_get_comp_words_by_ref.exp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/_get_comp_words_by_ref.exp b/test/unit/_get_comp_words_by_ref.exp
index ad07a659..82447966 100644
--- a/test/unit/_get_comp_words_by_ref.exp
+++ b/test/unit/_get_comp_words_by_ref.exp
@@ -48,6 +48,22 @@ assert_bash_list {" a"} $cmd $test
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 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