m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 16:45:38 -05:00

Fix flaky test cases

This commit is contained in:
Junegunn Choi
2016-04-24 04:52:01 +09:00
parent 772fa42dcb
commit bb70923cd8

View File

@@ -31,7 +31,7 @@ def wait
return if yield return if yield
sleep 0.05 sleep 0.05
end end
throw 'timeout' raise 'timeout'
end end
class Shell class Shell
@@ -1117,13 +1117,9 @@ class TestGoFZF < TestBase
def test_exitstatus_empty def test_exitstatus_empty
{ '99' => '0', '999' => '1' }.each do |query, status| { '99' => '0', '999' => '1' }.each do |query, status|
tmux.send_keys "seq 100 | #{FZF} -q #{query}", :Enter tmux.send_keys "seq 100 | #{FZF} -q #{query}; echo --\\$?--", :Enter
tmux.until { |lines| lines[-2] =~ %r{ [10]/100} } tmux.until { |lines| lines[-2] =~ %r{ [10]/100} }
tmux.send_keys :Enter tmux.send_keys :Enter
tmux.send_keys 'echo --\$?--'
tmux.until { |lines| lines.last.include? "echo --$?--" }
tmux.send_keys :Enter
tmux.until { |lines| lines.last.include? "--#{status}--" } tmux.until { |lines| lines.last.include? "--#{status}--" }
end end
end end