From 64443221aab288a3069d01cdaf86706c6c1d91f3 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 12 Sep 2015 11:37:55 +0900 Subject: Fix #344 - Backward scan when `--tiebreak=end` --- test/test_go.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/test_go.rb b/test/test_go.rb index 377af229..d1f45dc1 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -527,6 +527,17 @@ class TestGoFZF < TestBase assert_equal output, `cat #{tempname} | #{FZF} -fh -n2 -d:`.split($/) end + def test_tiebreak_end_backward_scan + input = %w[ + foobar-fb + fubar + ] + writelines tempname, input + + assert_equal input.reverse, `cat #{tempname} | #{FZF} -f fb`.split($/) + assert_equal input, `cat #{tempname} | #{FZF} -f fb --tiebreak=end`.split($/) + end + def test_invalid_cache tmux.send_keys "(echo d; echo D; echo x) | #{fzf '-q d'}", :Enter tmux.until { |lines| lines[-2].include? '2/3' } -- cgit v1.2.3