Skip to content
Myr

Fix flaky 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 2ccdf21 · Browse files · 1 file+3 added−1 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+3 added−1 removed

  • tests:+3 added−1 removed

1 file+3 added−1 removed

modified:test/test_go.rb+3 added-1 removed
895 unmodified lines
896 def test_execute_shell897 # Custom script to use as $SHELL898 output = tempname + '.out'899 File.unlink output rescue nil900 writelines tempname, ['#!/usr/bin/env bash', "echo $1 / $2 > #{output}"]900 writelines tempname, ['#!/usr/bin/env bash', "echo $1 / $2 > #{output}", "sync"]901 system "chmod +x #{tempname}"902903 tmux.send_keys "echo foo | SHELL=#{tempname} fzf --bind 'enter:execute:{}bar'", :Enter904 tmux.until { |lines| lines[-2].include? '1/1' }905 tmux.send_keys :Enter906 tmux.until { |lines| lines[-2].include? '1/1' }907 tmux.send_keys 'C-c'908 tmux.prepare909 assert_equal ['-c / "foo"bar'], File.readlines(output).map(&:chomp)910 ensure911 File.unlink output rescue nil912 end
549 unmodified lines