mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-22 21:05:09 +00:00
Fix flaky test case
This commit is contained in:
parent
2ccdf21a1f
commit
6cf54833f7
@ -897,13 +897,15 @@ class TestGoFZF < TestBase
|
|||||||
# Custom script to use as $SHELL
|
# Custom script to use as $SHELL
|
||||||
output = tempname + '.out'
|
output = tempname + '.out'
|
||||||
File.unlink output rescue nil
|
File.unlink output rescue nil
|
||||||
writelines tempname, ['#!/usr/bin/env bash', "echo $1 / $2 > #{output}"]
|
writelines tempname, ['#!/usr/bin/env bash', "echo $1 / $2 > #{output}", "sync"]
|
||||||
system "chmod +x #{tempname}"
|
system "chmod +x #{tempname}"
|
||||||
|
|
||||||
tmux.send_keys "echo foo | SHELL=#{tempname} fzf --bind 'enter:execute:{}bar'", :Enter
|
tmux.send_keys "echo foo | SHELL=#{tempname} fzf --bind 'enter:execute:{}bar'", :Enter
|
||||||
tmux.until { |lines| lines[-2].include? '1/1' }
|
tmux.until { |lines| lines[-2].include? '1/1' }
|
||||||
tmux.send_keys :Enter
|
tmux.send_keys :Enter
|
||||||
|
tmux.until { |lines| lines[-2].include? '1/1' }
|
||||||
tmux.send_keys 'C-c'
|
tmux.send_keys 'C-c'
|
||||||
|
tmux.prepare
|
||||||
assert_equal ['-c / "foo"bar'], File.readlines(output).map(&:chomp)
|
assert_equal ['-c / "foo"bar'], File.readlines(output).map(&:chomp)
|
||||||
ensure
|
ensure
|
||||||
File.unlink output rescue nil
|
File.unlink output rescue nil
|
||||||
|
Loading…
Reference in New Issue
Block a user