summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-06-11 19:59:12 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-06-11 19:59:12 +0900
commit2bbc12063c475cb7c78c7633e2ffad41aa49d233 (patch)
tree804bc0745e929d5cc69c55ac96c43bf2a81867d0 /test
parentb8737b724bf5e7df15bb18fd1a33e57b4e4fe1ab (diff)
Add --preview and --preview-window
Close #587
Diffstat (limited to 'test')
-rw-r--r--test/test_go.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index bb35bbf0..a6d67190 100644
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -1228,6 +1228,28 @@ class TestGoFZF < TestBase
assert_equal '3', readonce.chomp
end
+ def test_preview
+ tmux.send_keys %[seq 1000 | #{FZF} --preview 'echo {{}-{}}' --bind ?:toggle-preview], :Enter
+ tmux.until { |lines| lines[1].include?(' {1-1}') }
+ tmux.send_keys '555'
+ tmux.until { |lines| lines[1].include?(' {555-555}') }
+ tmux.send_keys '?'
+ tmux.until { |lines| !lines[1].include?(' {555-555}') }
+ tmux.send_keys '?'
+ tmux.until { |lines| lines[1].include?(' {555-555}') }
+ end
+
+ def test_preview_hidden
+ tmux.send_keys %[seq 1000 | #{FZF} --preview 'echo {{}-{}}' --preview-window down:1:hidden --bind ?:toggle-preview], :Enter
+ tmux.until { |lines| lines[-1] == '>' }
+ tmux.send_keys '?'
+ tmux.until { |lines| lines[-2].include?(' {1-1}') }
+ tmux.send_keys '555'
+ tmux.until { |lines| lines[-2].include?(' {555-555}') }
+ tmux.send_keys '?'
+ tmux.until { |lines| lines[-1] == '> 555' }
+ end
+
private
def writelines path, lines
File.unlink path while File.exists? path