mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-15 17:57:07 +00:00
Add retries to CTRL-R tests to avoid intermittent errors on Travis CI
- https://travis-ci.org/junegunn/fzf/jobs/659496745#L676 Related #1900
This commit is contained in:
parent
baf882ace7
commit
7c40a424c0
@ -1853,9 +1853,11 @@ module TestShell
|
|||||||
def test_ctrl_r_multiline
|
def test_ctrl_r_multiline
|
||||||
tmux.send_keys 'echo "foo', :Enter, 'bar"', :Enter
|
tmux.send_keys 'echo "foo', :Enter, 'bar"', :Enter
|
||||||
tmux.until { |lines| lines[-2..-1] == ['foo', 'bar'] }
|
tmux.until { |lines| lines[-2..-1] == ['foo', 'bar'] }
|
||||||
tmux.prepare
|
retries do
|
||||||
tmux.send_keys 'C-r'
|
tmux.prepare
|
||||||
tmux.until { |lines| lines[-1] == '>' }
|
tmux.send_keys 'C-r'
|
||||||
|
tmux.until { |lines| lines[-1] == '>' }
|
||||||
|
end
|
||||||
tmux.send_keys 'foo bar'
|
tmux.send_keys 'foo bar'
|
||||||
tmux.until { |lines| lines[-3].end_with? 'bar"' }
|
tmux.until { |lines| lines[-3].end_with? 'bar"' }
|
||||||
tmux.send_keys :Enter
|
tmux.send_keys :Enter
|
||||||
@ -1867,11 +1869,13 @@ module TestShell
|
|||||||
def test_ctrl_r_abort
|
def test_ctrl_r_abort
|
||||||
skip "doesn't restore the original line when search is aborted pre Bash 4" if shell == :bash && /(?<= version )\d+/.match(`#{Shell.bash} --version`).to_s.to_i < 4
|
skip "doesn't restore the original line when search is aborted pre Bash 4" if shell == :bash && /(?<= version )\d+/.match(`#{Shell.bash} --version`).to_s.to_i < 4
|
||||||
%w[foo ' "].each do |query|
|
%w[foo ' "].each do |query|
|
||||||
tmux.prepare
|
retries do
|
||||||
tmux.send_keys(query)
|
tmux.prepare
|
||||||
tmux.until { |lines| lines[-1].start_with? query }
|
tmux.send_keys(:Space, 'C-e', 'C-u', query)
|
||||||
tmux.send_keys 'C-r'
|
tmux.until { |lines| lines[-1].start_with? query }
|
||||||
tmux.until { |lines| lines[-1] == "> #{query}" }
|
tmux.send_keys 'C-r'
|
||||||
|
tmux.until { |lines| lines[-1] == "> #{query}" }
|
||||||
|
end
|
||||||
tmux.send_keys 'C-g'
|
tmux.send_keys 'C-g'
|
||||||
tmux.until { |lines| lines[-1].start_with? query }
|
tmux.until { |lines| lines[-1].start_with? query }
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user