diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2016-06-11 19:59:12 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-06-11 19:59:12 +0900 |
| commit | 2bbc12063c475cb7c78c7633e2ffad41aa49d233 (patch) | |
| tree | 804bc0745e929d5cc69c55ac96c43bf2a81867d0 /test | |
| parent | b8737b724bf5e7df15bb18fd1a33e57b4e4fe1ab (diff) | |
| download | fzf-2bbc12063c475cb7c78c7633e2ffad41aa49d233.tar.gz | |
Add --preview and --preview-window
Close #587
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_go.rb | 22 |
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 |
