From 8ec917b1c36ed1cf6ace64419307aa85fda4bee3 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 1 Apr 2023 17:16:02 +0900 Subject: Add 'one' event Close #2629 Close #2494 Close #459 --- test/test_go.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') 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 -- cgit v1.2.3