diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2019-12-07 14:44:24 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2019-12-07 14:44:24 +0900 |
commit | af1a5f130bbd2464131ec2ae91c538ace6801a73 (patch) | |
tree | 29603019f0a61d0b212ec9220b4b54070f879c46 /test | |
parent | 86e3994e87b264f874ea1620fc31f42e3744aad0 (diff) |
Add clear-query and clear-selection
Close #1787
Related #1364
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_go.rb | 23 |
1 files changed, 23 insertions, 0 deletions
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 |