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.

authored by Junegunn Choi · committed by Junegunn Choi · parent 2d68cb8 · Browse files · 2 files+23 added−15 removed
This commit

State

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

Diff stats

2 files+23 added−15 removed

  • tests:+20 added−8 removed
  • other:+3 added−7 removed

2 files+23 added−15 removed

modified:test/test_go.rb+20 added-8 removed
2 unmodified lines
34require 'minitest/autorun'5require 'fileutils'67Dir.chdir File.expand_path('../../', __FILE__)7base = File.expand_path('../../', __FILE__)8Dir.chdir base9FZF = "#{base}/bin/fzf"1011class NilClass12 def include? str13 false
13 unmodified lines
27 name = self.class::TEMPNAME28 waited = 029 while waited < 530 begin29 data = `cat #{name}`31 system 'sync'32 data = File.read(name)33 return data unless data.empty?34 rescue35 sleep 0.136 waited += 0.1
160 unmodified lines
197 else198 nil199 end200 }.compact198 "fzf #{opts.join ' '}"201 "#{FZF} #{opts.join ' '}"202 end203end204205class TestGoFZF < TestBase
39 unmodified lines
245 assert_equal 'hello', readonce.chomp246 end247248 def test_key_bindings246 tmux.send_keys "fzf -q 'foo bar foo-bar'", :Enter249 tmux.send_keys "#{FZF} -q 'foo bar foo-bar'", :Enter250 tmux.until { |lines| lines.last =~ /^>/ }251252 # CTRL-A253 tmux.send_keys "C-A", "("
220 unmodified lines
474 assert_equal ['111', '11'], readonce.split($/)475 end476477 def test_unicode_case475 assert_equal %w[СТРОКА2 Строка4],476 `ruby -e "puts %w[строКА1 СТРОКА2 строка3 Строка4]" | fzf -fС`.split($/)477 assert_equal %w[строКА1 СТРОКА2 строка3 Строка4],478 `ruby -e "puts %w[строКА1 СТРОКА2 строка3 Строка4]" | fzf -fс`.split($/)478 tempname = TEMPNAME + Time.now.to_f.to_s479 File.open(tempname, 'w') do |f|480 f << %w[строКА1 СТРОКА2 строка3 Строка4].join($/)481 f.sync482 end483 since = Time.now484 while `cat #{tempname}`.split($/).length != 4 && (Time.now - since) < 10485 sleep 0.1486 end487 assert_equal %w[СТРОКА2 Строка4], `cat #{tempname} | #{FZF} -fС`.split($/)488 assert_equal %w[строКА1 СТРОКА2 строка3 Строка4], `cat #{tempname} | #{FZF} -fс`.split($/)489 rescue490 File.unlink tempname491 end492end493494module TestShell
156 unmodified lines
modified:.travis.yml+3 added-7 removed