summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2023-03-29 20:36:09 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2023-04-01 12:59:44 +0900
commit1c7534f00966edca7c44054af199ca27aca0a80c (patch)
tree58ec99c05fc552f69ce05dc8160d70324254e6fd /test
parentae745d9397bdc8b91f3c1834def3b8ecb0ae57b1 (diff)
Add --track option to track the current selection
Close #3186 Related #1890
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_go.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 8da6cb5e..1556c73b 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -2679,6 +2679,29 @@ class TestGoFZF < TestBase
OUTPUT
tmux.until { assert_block(expected, _1) }
end
+
+ def test_track
+ tmux.send_keys "seq 1000 | #{FZF} --query 555 --track", :Enter
+ tmux.until do |lines|
+ assert_equal 1, lines.match_count
+ assert_includes lines, '> 555'
+ end
+ tmux.send_keys :BSpace
+ index = tmux.until do |lines|
+ assert_equal 28, lines.match_count
+ assert_includes lines, '> 555'
+ end.index('> 555')
+ tmux.send_keys :BSpace
+ tmux.until do |lines|
+ assert_equal 271, lines.match_count
+ assert_equal '> 555', lines[index]
+ end
+ tmux.send_keys :BSpace
+ tmux.until do |lines|
+ assert_equal 1000, lines.match_count
+ assert_equal '> 555', lines[index]
+ end
+ end
end
module TestShell