Skip to content
Myr

More test cases for --bind

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 3cdf718 · Browse files · 1 file+16 added−13 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+16 added−13 removed

  • tests:+16 added−13 removed

1 file+16 added−13 removed

modified:test/test_go.rb+16 added-13 removed
437 unmodified lines
438 assert_equal ['55', '', '55'], readonce.split($/)439 end440441 def test_toggle_sort442 ['--toggle-sort=ctrl-r', '--bind=ctrl-r:toggle-sort'].each do |opt|442 tmux.send_keys "seq 1 111 | #{fzf '-m +s --tac --toggle-sort=ctrl-r -q11'}", :Enter443 tmux.until { |lines| lines[-3].include? '> 111' }444 tmux.send_keys :Tab445 tmux.until { |lines| lines[-2].include? '4/111 (1)' }446 tmux.send_keys 'C-R'447 tmux.until { |lines| lines[-3].include? '> 11' }448 tmux.send_keys :Tab449 tmux.until { |lines| lines[-2].include? '4/111/S (2)' }450 tmux.send_keys :Enter451 assert_equal ['111', '11'], readonce.split($/)443 tmux.send_keys "seq 1 111 | #{fzf "-m +s --tac #{opt} -q11"}", :Enter444 tmux.until { |lines| lines[-3].include? '> 111' }445 tmux.send_keys :Tab446 tmux.until { |lines| lines[-2].include? '4/111 (1)' }447 tmux.send_keys 'C-R'448 tmux.until { |lines| lines[-3].include? '> 11' }449 tmux.send_keys :Tab450 tmux.until { |lines| lines[-2].include? '4/111/S (2)' }451 tmux.send_keys :Enter452 assert_equal ['111', '11'], readonce.split($/)453 end454 end455456 def test_unicode_case457 tempname = TEMPNAME + Time.now.to_f.to_s
60 unmodified lines
518 assert_equal 1, `echo Foo bar | #{FZF} -x -f "foo Fbar" | wc -l`.to_i519 end520521 def test_bind520 tmux.send_keys "seq 1 1000 | #{fzf '-m --bind=ctrl-j:accept,z:up,x:toggle-up'}", :Enter522 tmux.send_keys "seq 1 1000 | #{523 fzf '-m --bind=ctrl-j:accept,u:up,T:toggle-up,t:toggle'}", :Enter524 tmux.until { |lines| lines[-2].end_with? '/1000' }522 tmux.send_keys 'zzz', 'xx', 'C-j'523 assert_equal %w[4 5], readonce.split($/)525 tmux.send_keys 'uuu', 'TTT', 'tt', 'uu', 'ttt', 'C-j'526 assert_equal %w[4 5 6 9], readonce.split($/)527 end528private529 def writelines path, lines530 File.unlink path while File.exists? path
209 unmodified lines