summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2023-04-01 17:16:02 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2023-04-01 17:25:47 +0900
commit8ec917b1c36ed1cf6ace64419307aa85fda4bee3 (patch)
tree74d6f5e0e59a82ad13f0d51cd51aa8ee34c36025 /test
parent1c7534f00966edca7c44054af199ca27aca0a80c (diff)
Add 'one' event
Close #2629 Close #2494 Close #459
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_go.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 1556c73b..8d8a9819 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -2702,6 +2702,20 @@ class TestGoFZF < TestBase
assert_equal '> 555', lines[index]
end
end
+
+ def test_one
+ tmux.send_keys "seq 10 | #{FZF} --bind 'one:preview:echo {} is the only match'", :Enter
+ tmux.send_keys '1'
+ tmux.until do |lines|
+ assert_equal 2, lines.match_count
+ refute lines.any? { _1.include?('only match') }
+ end
+ tmux.send_keys '0'
+ tmux.until do |lines|
+ assert_equal 1, lines.match_count
+ assert lines.any? { _1.include?('only match') }
+ end
+ end
end
module TestShell