summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-06-08 02:04:40 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-06-08 02:04:40 +0900
commit3a644b16a42d26134d986e58675e74c99de8c659 (patch)
tree253ea92e8f7a429550c919f2b6206a3d35772e84
parent95b34de339822d6e81898c7e52f94a7165be39bc (diff)
Update test_execute (#590)
-rw-r--r--test/test_go.rb29
1 files changed, 16 insertions, 13 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index d886c323..ef7aa3a4 100644
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -869,31 +869,34 @@ class TestGoFZF < TestBase
def test_execute
output = '/tmp/fzf-test-execute'
- opts = %[--bind \\"alt-a:execute(echo '[{}]' >> #{output}),alt-b:execute[echo '({}), ({})' >> #{output}],C:execute:echo '({}), [{}], @{}@' >> #{output}\\"]
+ opts = %[--bind \\"alt-a:execute(echo [{}] >> #{output}),alt-b:execute[echo /{}{}/ >> #{output}],C:execute:echo /{}{}{}/ >> #{output}\\"]
wait = lambda { |exp| tmux.until { |lines| lines[-2].include? exp } }
- tmux.send_keys "seq 100 | #{fzf opts}; sync", :Enter
- wait['100/100']
+ writelines tempname, %w[foo'bar foo"bar foo$bar]
+ tmux.send_keys "cat #{tempname} | #{fzf opts}; sync", :Enter
+ wait['3/3']
tmux.send_keys :Escape, :a
- wait['/100']
+ wait['/3']
tmux.send_keys :Escape, :a
- wait['/100']
+ wait['/3']
tmux.send_keys :Up
tmux.send_keys :Escape, :b
- wait['/100']
+ wait['/3']
tmux.send_keys :Escape, :b
- wait['/100']
+ wait['/3']
tmux.send_keys :Up
tmux.send_keys :C
- wait['100/100']
- tmux.send_keys 'foobar'
- wait['0/100']
+ wait['3/3']
+ tmux.send_keys 'barfoo'
+ wait['0/3']
tmux.send_keys :Escape, :a
- wait['/100']
+ wait['/3']
tmux.send_keys :Escape, :b
- wait['/100']
+ wait['/3']
tmux.send_keys :Enter
readonce
- assert_equal ['["1"]', '["1"]', '("2"), ("2")', '("2"), ("2")', '("3"), ["3"], @"3"@'],
+ assert_equal %w[[foo'bar] [foo'bar]
+ /foo"barfoo"bar/ /foo"barfoo"bar/
+ /foo$barfoo$barfoo$bar/],
File.readlines(output).map(&:chomp)
ensure
File.unlink output rescue nil