summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2023-04-22 23:39:35 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2023-04-22 23:42:09 +0900
commit65dd2bb42947d4ede31d160214f3a4c6fdc619e1 (patch)
tree8f5744ddc7d0ab91983fdf6df28d96d253b2aa54 /test
parent6be855be6af102a0f89932e5752ce75aa9713108 (diff)
Add 'track' action
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_go.rb42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 34884550..fc0b9e04 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -2793,6 +2793,48 @@ class TestGoFZF < TestBase
end
end
+ def test_track_action
+ tmux.send_keys "seq 1000 | #{FZF} --query 555 --bind t:track", :Enter
+ tmux.until do |lines|
+ assert_equal 1, lines.match_count
+ assert_includes lines, '> 555'
+ end
+ tmux.send_keys :BSpace
+ tmux.until do |lines|
+ assert_equal 28, lines.match_count
+ assert_includes lines, '> 55'
+ end
+ tmux.send_keys :t
+ tmux.until do |lines|
+ assert_includes lines[-2], '+T'
+ end
+ tmux.send_keys :BSpace
+ tmux.until do |lines|
+ assert_equal 271, lines.match_count
+ assert_includes lines, '> 55'
+ end
+
+ # Automatically disabled when the tracking item is no longer visible
+ tmux.send_keys '4'
+ tmux.until do |lines|
+ assert_equal 28, lines.match_count
+ refute_includes lines[-2], '+T'
+ end
+ tmux.send_keys :BSpace
+ tmux.until do |lines|
+ assert_equal 271, lines.match_count
+ assert_includes lines, '> 5'
+ end
+ tmux.send_keys :t
+ tmux.until do |lines|
+ assert_includes lines[-2], '+T'
+ end
+ tmux.send_keys :Up
+ tmux.until do |lines|
+ refute_includes lines[-2], '+T'
+ end
+ end
+
def test_one
tmux.send_keys "seq 10 | #{FZF} --bind 'one:preview:echo {} is the only match'", :Enter
tmux.send_keys '1'