Skip to content
Myr

Fix race condition in test case

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

authored by Junegunn Choi · committed by Junegunn Choi · parent 5502b68 · Browse files · 1 file+4 added−2 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+4 added−2 removed

  • tests:+4 added−2 removed

1 file+4 added−2 removed

modified:test/test_go.rb+4 added-2 removed
387 unmodified lines
388 def test_tac_nosort389 tmux.send_keys "seq 1 1000 | #{fzf :tac, :no_sort, :multi}", :Enter390 tmux.until { |lines| lines[-2].include? '1000/1000' }391 tmux.send_keys '00'392 tmux.until { |lines| lines[-2].include? '10/1000' }393 tmux.send_keys :BTab, :BTab, :BTab, :Enter394 assert_equal %w[1000 900 800], readonce.split($/)395 end396
1 unmodified line
398 test = lambda do |key, feed, expected = key|399 tmux.send_keys "seq 1 100 | #{fzf :expect, key}", :Enter400 tmux.until { |lines| lines[-2].include? '100/100' }401 tmux.send_keys '55'402 tmux.until { |lines| lines[-2].include? '1/100' }403 tmux.send_keys *feed404 assert_equal [expected, '55'], readonce.split($/)405 end406 test.call 'ctrl-t', 'C-T'
10 unmodified lines
417 def test_expect_print_query418 tmux.send_keys "seq 1 100 | #{fzf '--expect=alt-z', :print_query}", :Enter419 tmux.until { |lines| lines[-2].include? '100/100' }420 tmux.send_keys '55'421 tmux.until { |lines| lines[-2].include? '1/100' }422 tmux.send_keys :Escape, :z423 assert_equal ['55', 'alt-z', '55'], readonce.split($/)424 end425
119 unmodified lines
545 tmux.prepare546 tmux.send_keys :Escape, :c, pane: 0547 lines = tmux.until(1) { |lines| lines.item_count > 0 }548 expected = lines[-3][2..-1]546 p expected549 tmux.send_keys :Enter, pane: 1550 tmux.prepare551 tmux.send_keys :pwd, :Enter550 tmux.until { |lines| p lines; lines[-1].end_with?(expected) }552 tmux.until { |lines| lines[-1].end_with?(expected) }553 end554555 def test_ctrl_r556 tmux.prepare
115 unmodified lines