mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-25 06:07:42 +00:00
Update test_execute (#590)
This commit is contained in:
parent
95b34de339
commit
3a644b16a4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user