Skip to content
Myr

Fix travis CI build

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

- Fix test failures on new fish 2.2.0 - Make timeout-based test cases more robust

authored by Junegunn Choi · committed by Junegunn Choi · parent 392da53 · Browse files · 1 file+31 added−11 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+31 added−11 removed

  • tests:+31 added−11 removed

1 file+31 added−11 removed

modified:test/test_go.rb+31 added-11 removed
310 unmodified lines
311 assert_equal '> 2nd 3rd/1st', lines[-3]312313 # However, the output must not be transformed314 if multi315 tmux.send_keys :BTab, :BTab, :Enter315 tmux.send_keys :BTab, :BTab316 tmux.until { |lines| lines[-2].include?('(2)') }317 tmux.send_keys :Enter318 assert_equal [' 1st 2nd 3rd/', ' first second third/'], readonce.split($/)319 else320 tmux.send_keys '^', '3'321 tmux.until { |lines| lines[-2].include?('1/2') }
27 unmodified lines
349 def test_select_1_exit_0_fail350 [:'0', :'1', [:'1', :'0']].each do |opt|351 tmux.send_keys "seq 1 100 | #{fzf :print_query, :multi, :q, 5, *opt}", :Enter352 tmux.until { |lines| lines.last =~ /^> 5/ }351 tmux.send_keys :BTab, :BTab, :BTab, :Enter353 tmux.send_keys :BTab, :BTab, :BTab354 tmux.until { |lines| lines[-2].include?('(3)') }355 tmux.send_keys :Enter356 assert_equal ['5', '5', '15', '25'], readonce.split($/)357 end358 end359
8 unmodified lines
368 tmux.send_keys "seq 1 100 | #{fzf! :multi} | awk '{print \\$1 \\$1}' | #{fzf :sync}", :Enter369 tmux.until { |lines| lines[-1] == '>' }370 tmux.send_keys 9371 tmux.until { |lines| lines[-2] == ' 19/100' }368 tmux.send_keys :BTab, :BTab, :BTab, :Enter372 tmux.send_keys :BTab, :BTab, :BTab373 tmux.until { |lines| lines[-2].include?('(3)') }374 tmux.send_keys :Enter375 tmux.until { |lines| lines[-1] == '>' }376 tmux.send_keys 'C-K', :Enter377 assert_equal ['1919'], readonce.split($/)378 end379380 def test_tac381 tmux.send_keys "seq 1 1000 | #{fzf :tac, :multi}", :Enter382 tmux.until { |lines| lines[-2].include? '1000/1000' }377 tmux.send_keys :BTab, :BTab, :BTab, :Enter383 tmux.send_keys :BTab, :BTab, :BTab384 tmux.until { |lines| lines[-2].include?('(3)') }385 tmux.send_keys :Enter386 assert_equal %w[1000 999 998], readonce.split($/)387 end388389 def test_tac_sort390 tmux.send_keys "seq 1 1000 | #{fzf :tac, :multi}", :Enter391 tmux.until { |lines| lines[-2].include? '1000/1000' }392 tmux.send_keys '99'385 tmux.send_keys :BTab, :BTab, :BTab, :Enter393 tmux.send_keys :BTab, :BTab, :BTab394 tmux.until { |lines| lines[-2].include?('(3)') }395 tmux.send_keys :Enter396 assert_equal %w[99 999 998], readonce.split($/)397 end398399 def test_tac_nosort400 tmux.send_keys "seq 1 1000 | #{fzf :tac, :no_sort, :multi}", :Enter401 tmux.until { |lines| lines[-2].include? '1000/1000' }402 tmux.send_keys '00'403 tmux.until { |lines| lines[-2].include? '10/1000' }394 tmux.send_keys :BTab, :BTab, :BTab, :Enter404 tmux.send_keys :BTab, :BTab, :BTab405 tmux.until { |lines| lines[-2].include?('(3)') }406 tmux.send_keys :Enter407 assert_equal %w[1000 900 800], readonce.split($/)408 end409410 def test_expect
263 unmodified lines
674 tmux.prepare675 tmux.send_keys 'C-t', pane: 0676 lines = tmux.until(1) { |lines| lines.item_count > 1 }677 expected = lines.values_at(-3, -4).map { |line| line[2..-1] }.join(' ')666 tmux.send_keys :BTab, :BTab, :Enter, pane: 1678 tmux.send_keys :BTab, :BTab, pane: 1679 tmux.until(1) { |lines| lines[-2].include?('(2)') }680 tmux.send_keys :Enter, pane: 1681 tmux.until(0) { |lines| lines[-1].include? expected }682 tmux.send_keys 'C-c'683684 # FZF_TMUX=0685 new_shell686 tmux.send_keys 'C-t', pane: 0687 lines = tmux.until(0) { |lines| lines.item_count > 1 }688 expected = lines.values_at(-3, -4).map { |line| line[2..-1] }.join(' ')675 tmux.send_keys :BTab, :BTab, :Enter, pane: 0689 tmux.send_keys :BTab, :BTab, pane: 0690 tmux.until(0) { |lines| lines[-2].include?('(2)') }691 tmux.send_keys :Enter, pane: 0692 tmux.until(0) { |lines| lines[-1].include? expected }693 tmux.send_keys 'C-c', 'C-d'694 end695696 def test_ctrl_t_command697 set_var "FZF_CTRL_T_COMMAND", "seq 100"698 tmux.send_keys 'C-t', pane: 0699 lines = tmux.until(1) { |lines| lines.item_count == 100 }684 tmux.send_keys :BTab, :BTab, :BTab, :Enter, pane: 1700 tmux.send_keys :BTab, :BTab, :BTab, pane: 1701 tmux.until(1) { |lines| lines[-2].include?('(3)') }702 tmux.send_keys :Enter, pane: 1703 tmux.until(0) { |lines| lines[-1].include? '1 2 3' }704 end705706 def test_alt_c
35 unmodified lines
742 end743 tmux.prepare744 tmux.send_keys 'cat /tmp/fzf-test/10**', :Tab, pane: 0745 tmux.until(1) { |lines| lines.item_count > 0 }728 tmux.send_keys :BTab, :BTab, :Enter746 tmux.send_keys :BTab, :BTab747 tmux.until(1) { |lines| lines[-2].include?('(2)') }748 tmux.send_keys :Enter749 tmux.until do |lines|750 tmux.send_keys 'C-L'751 lines[-1].include?('/tmp/fzf-test/10') &&752 lines[-1].include?('/tmp/fzf-test/100')
125 unmodified lines
878 end879880 def set_var name, val881 tmux.prepare862 tmux.send_keys "set -l #{name} '#{val}'", :Enter882 tmux.send_keys "set -g #{name} '#{val}'", :Enter883 tmux.prepare884 end885886 def setup
5 unmodified lines