From af1a5f130bbd2464131ec2ae91c538ace6801a73 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 7 Dec 2019 14:44:24 +0900 Subject: Add clear-query and clear-selection Close #1787 Related #1364 --- test/test_go.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test') diff --git a/test/test_go.rb b/test/test_go.rb index 55c8fc2b..d2fe1809 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -1654,6 +1654,29 @@ class TestGoFZF < TestBase tmux.send_keys :Space tmux.until { |lines| lines.none? { |line| line.include?('9') } } end + + def test_clear_query + tmux.send_keys %(: | #{FZF} --query foo --bind space:clear-query), :Enter + tmux.until { |lines| lines.item_count.zero? } + tmux.until { |lines| lines.last.include?('> foo') } + tmux.send_keys 'C-a', 'bar' + tmux.until { |lines| lines.last.include?('> barfoo') } + tmux.send_keys :Space + tmux.until { |lines| lines.last == '>' } + end + + def test_clear_selection + tmux.send_keys %(seq 100 | #{FZF} --multi --bind space:clear-selection), :Enter + tmux.until { |lines| lines.match_count == 100 } + tmux.send_keys :Tab + tmux.until { |lines| lines[-2].include?('(1)') } + tmux.send_keys 'foo' + tmux.until { |lines| lines.match_count.zero? } + tmux.until { |lines| lines[-2].include?('(1)') } + tmux.send_keys :Space + tmux.until { |lines| lines.match_count.zero? } + tmux.until { |lines| !lines[-2].include?('(1)') } + end end module TestShell -- cgit v1.2.3