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 ae3180f · Browse files · 2 files·+30 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+30 added−15 removed
- tests:+15 added−6 removed
- other:+15 added−9 removed
Provenance
- Commit
c0b432f- Tree
4db0762- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
ae3180f
2 files changed+30 added−15 removed
modified:test/test_go.rb+15 added-6 removed
8 unmodified lines9 attr_reader :win10 11 def initialize shell = 'bash'12 @win = go("new-window -P -F '#I' 'bash --rcfile ~/.fzf.#{shell}'").first13+ @lines = `tput lines`.chomp.to_i14 end15 16 def self.current17 `tmux display-message -p '#I'`.split($/).first7 unmodified lines25 !go("list-window -F '#I'").include?(win)26 end27 28 def close timeout = 128- send_keys 'C-c', 'C-u', 'C-d'29+ send_keys 'C-c', 'C-u', 'exit', :Enter30 wait(timeout) { closed? }31 end32 33 def kill7 unmodified lines41 42 def capture43 go("capture-pane -t #{win} \\; save-buffer #{TEMPNAME}")44 raise "Window not found" if $?.exitstatus != 044- File.read(TEMPNAME).split($/)45+ File.read(TEMPNAME).split($/)[0, @lines]46 end47 48 def until timeout = 149 wait(timeout) { yield capture }4 unmodified lines54 waited = 055 until yield56 waited += 0.157 sleep 0.157- raise "timeout" if waited > timeout58+ if waited > timeout59+ hl = '=' * 1060+ puts hl61+ capture.each_with_index do |line, idx|62+ puts [idx.to_s.rjust(2), line].join(': ')63+ end64+ puts hl65+ raise "timeout"66+ end67 end68 end69 70 def go *args22 unmodified lines93 end94 95 def test_vanilla96 tmux.send_keys "seq 1 100000 | fzf > #{tempname}", :Enter88- tmux.until { |lines| lines.last =~ /^>/ && lines[-2] =~ /^ 100000/ }97+ tmux.until(10) { |lines| lines.last =~ /^>/ && lines[-2] =~ /^ 100000/ }98 lines = tmux.capture99 assert_equal ' 2', lines[-4]100 assert_equal '> 1', lines[-3]101 assert_equal ' 100000/100000', lines[-2]102 assert_equal '>', lines[-1]103 104 # Testing basic key bindings105 tmux.send_keys '99', 'C-a', '1', 'C-f', '3', 'C-b', 'C-h', 'C-u', 'C-e', 'C-y', 'C-k', 'Tab', 'BTab'97- tmux.until { |lines| lines.last == '> 391' }106+ tmux.until { |lines| lines[-2] == ' 856/100000' }107 lines = tmux.capture108 assert_equal '> 1391', lines[-4]109 assert_equal ' 391', lines[-3]110 assert_equal ' 856/100000', lines[-2]14 unmodified lines125 end126 127 def test_fzf_prompt128 tmux.send_keys "fzf -q 'foo bar foo-bar'", :Enter120- tmux.until { |lines| lines.last =~ /foo-bar/ }129+ tmux.until { |lines| lines.last =~ /^>/ }130 131 # CTRL-A132 tmux.send_keys "C-A", "("133 tmux.until { |lines| lines.last == '> (foo bar foo-bar' }60 unmodified linesmodified:.travis.yml+15 added-9 removed
1232563456789101112131412151614171816192021181922232425language: rubyrvm: - "2.1.1"
before_script: | sudo apt-get install -y tmux libncurses-dev lib32ncurses5-devinstall:- sudo apt-get install -y libncurses-dev lib32ncurses5-dev- sudo add-apt-repository -y ppa:pi-rho/dev- sudo apt-get update- sudo apt-get install -y tmux=1.9a-1~ppa1~p
script: | export GOROOT=~/go1.4 export GOPATH=~/go export FZF_BASE=~/go/src/github.com/junegunn/fzf
mkdir -p ~/go/src/github.com/junegunn ln -s $(pwd) ~/go/src/github.com/junegunn/fzf ln -s $(pwd) $FZF_BASE
curl https://storage.googleapis.com/golang/go1.4.linux-amd64.tar.gz | tar -xz curl https://storage.googleapis.com/golang/go1.4.1.linux-amd64.tar.gz | tar -xz mv go $GOROOT cd $GOROOT/src && GOARCH=386 ./make.bash cd $GOROOT/src GOARCH=386 ./make.bash
cd ~/go/src/github.com/junegunn/fzf/src && make install && cd .. && yes | ./install && tmux cd $FZF_BASE/src && make install && cd $FZF_BASE/bin && ln -sf fzf-linux_amd64 fzf-$(./fzf --version)-linux_amd64 && cd $FZF_BASE && yes | ./install && tmux new "rake test > out && touch ok" && cat out && [ -e ok ]