summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2019-11-10 13:13:45 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2019-11-10 13:13:45 +0900
commite975bd0c8da25b51c0713d951af10cbd44cc3e15 (patch)
treeb5640c515eebd0fd13dc16e488df24fe416e6d24
parent78da9287272a0bfa183498c5b2e9fde10a3663a0 (diff)
Add test cases for --phony and reload action
-rwxr-xr-xtest/test_go.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 9282f9ee..1dbbf5ce 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -277,7 +277,7 @@ class TestGoFZF < TestBase
def test_fzf_default_command_failure
tmux.send_keys fzf.sub('FZF_DEFAULT_COMMAND=', 'FZF_DEFAULT_COMMAND=false'), :Enter
- tmux.until { |lines| lines[-2].include?('FZF_DEFAULT_COMMAND failed') }
+ tmux.until { |lines| lines[-2].include?('Command failed: false') }
tmux.send_keys :Enter
end
@@ -1612,6 +1612,26 @@ class TestGoFZF < TestBase
tmux.send_keys "#{FZF} --preview 'cat #{tempname}'", :Enter
tmux.until { |lines| lines[1].include?('+ green') }
end
+
+ def test_phony
+ tmux.send_keys %(seq 1000 | #{FZF} --query 333 --phony --preview 'echo {} {q}'), :Enter
+ tmux.until { |lines| lines.match_count == 1000 }
+ tmux.until { |lines| lines[1].include?('1 333') }
+ tmux.send_keys 'foo'
+ tmux.until { |lines| lines.match_count == 1000 }
+ tmux.until { |lines| lines[1].include?('1 333foo') }
+ end
+
+ def test_reload
+ tmux.send_keys %(seq 1000 | #{FZF} --bind 'change:reload(seq {q}),a:reload(seq 100),b:reload:seq 200'), :Enter
+ tmux.until { |lines| lines.match_count == 1000 }
+ tmux.send_keys 'a'
+ tmux.until { |lines| lines.item_count == 100 && lines.match_count == 100 }
+ tmux.send_keys 'b'
+ tmux.until { |lines| lines.item_count == 200 && lines.match_count == 200 }
+ tmux.send_keys '555'
+ tmux.until { |lines| lines.item_count == 555 && lines.match_count == 1 }
+ end
end
module TestShell