Fix flaky test case

This commit is contained in:
Junegunn Choi 2019-11-02 13:14:47 +09:00
parent 391669a451
commit a2e9366c84
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -873,7 +873,7 @@ 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 = ->(exp) { tmux.until { |lines| lines[-2].include? exp } }
writelines tempname, %w[foo'bar foo"bar foo$bar]
tmux.send_keys "cat #{tempname} | #{fzf opts}; sync", :Enter
@ -898,7 +898,7 @@ class TestGoFZF < TestBase
wait['/3']
tmux.send_keys :Enter
readonce
assert_equal %w[[foo'bar] [foo'bar]
assert_equal %w[/foo'bar/ /foo'bar/
/foo"barfoo"bar/ /foo"barfoo"bar/
/foo$barfoo$barfoo$bar/],
File.readlines(output).map(&:chomp)