Skip to content
Myr

Fix flaky test case: test_execute

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Should wait until execute action completes

authored by Junegunn Choi · committed by Junegunn Choi · parent 73cb70d · Browse files · 1 file+17 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+17 added−6 removed

  • tests:+17 added−6 removed

1 file+17 added−6 removed

modified:test/test_go.rb+17 added-6 removed
857 unmodified lines
858859 def test_execute860 output = '/tmp/fzf-test-execute'861 opts = %[--bind \\"alt-a:execute(echo '[{}]' >> #{output}),alt-b:execute[echo '({}), ({})' >> #{output}],C:execute:echo '({}), [{}], @{}@' >> #{output}\\"]862 tmux.send_keys "seq 100 | #{fzf opts}", :Enter863 tmux.until { |lines| lines[-2].include? '100/100' }864 tmux.send_keys :Escape, :a, :Escape, :a862 wait = lambda { |exp| tmux.until { |lines| lines[-2].include? exp } }863 tmux.send_keys "seq 100 | #{fzf opts}; sync", :Enter864 wait['100/100']865 tmux.send_keys :Escape, :a866 wait['/100']867 tmux.send_keys :Escape, :a868 wait['/100']869 tmux.send_keys :Up866 tmux.send_keys :Escape, :b, :Escape, :b870 tmux.send_keys :Escape, :b871 wait['/100']872 tmux.send_keys :Escape, :b873 wait['/100']874 tmux.send_keys :Up875 tmux.send_keys :C876 wait['100/100']877 tmux.send_keys 'foobar'870 tmux.until { |lines| lines[-2].include? '0/100' }871 tmux.send_keys :Escape, :a, :Escape, :b, :Escape, :c878 wait['0/100']879 tmux.send_keys :Escape, :a880 wait['/100']881 tmux.send_keys :Escape, :b882 wait['/100']883 tmux.send_keys :Enter884 readonce885 assert_equal ['["1"]', '["1"]', '("2"), ("2")', '("2"), ("2")', '("3"), ["3"], @"3"@'],886 File.readlines(output).map(&:chomp)
629 unmodified lines