mirror of
https://github.com/junegunn/fzf.git
synced 2025-12-07 21:34:28 +08:00
Fix flaky test case
This commit is contained in:
@@ -873,7 +873,7 @@ class TestGoFZF < TestBase
|
|||||||
|
|
||||||
def test_execute
|
def test_execute
|
||||||
output = '/tmp/fzf-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 } }
|
wait = ->(exp) { tmux.until { |lines| lines[-2].include? exp } }
|
||||||
writelines tempname, %w[foo'bar foo"bar foo$bar]
|
writelines tempname, %w[foo'bar foo"bar foo$bar]
|
||||||
tmux.send_keys "cat #{tempname} | #{fzf opts}; sync", :Enter
|
tmux.send_keys "cat #{tempname} | #{fzf opts}; sync", :Enter
|
||||||
@@ -898,7 +898,7 @@ class TestGoFZF < TestBase
|
|||||||
wait['/3']
|
wait['/3']
|
||||||
tmux.send_keys :Enter
|
tmux.send_keys :Enter
|
||||||
readonce
|
readonce
|
||||||
assert_equal %w[[foo'bar] [foo'bar]
|
assert_equal %w[/foo'bar/ /foo'bar/
|
||||||
/foo"barfoo"bar/ /foo"barfoo"bar/
|
/foo"barfoo"bar/ /foo"barfoo"bar/
|
||||||
/foo$barfoo$barfoo$bar/],
|
/foo$barfoo$barfoo$bar/],
|
||||||
File.readlines(output).map(&:chomp)
|
File.readlines(output).map(&:chomp)
|
||||||
|
|||||||
Reference in New Issue
Block a user