diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-08-01 23:13:24 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-08-01 23:13:24 +0900 |
commit | dea60b11bca22f4bf886ae7026bac44521038010 (patch) | |
tree | af17cedb91520ee1b6a490ea8e22d2cf49818aa8 /test | |
parent | 5e90f0a57bf21393a12ffc05e022760a71098d92 (diff) |
Only consider the lengths of the relevant parts when --nth is set
Diffstat (limited to 'test')
-rw-r--r-- | test/test_go.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb index 75fc01ca..c21c94e0 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -501,6 +501,32 @@ class TestGoFZF < TestBase assert_equal input, `cat #{tempname} | #{FZF} -f"!z" -x --tiebreak end`.split($/) end + def test_tiebreak_length_with_nth + input = %w[ + 1:hell + 123:hello + 12345:he + 1234567:h + ] + writelines tempname, input + + output = %w[ + 1:hell + 12345:he + 123:hello + 1234567:h + ] + assert_equal output, `cat #{tempname} | #{FZF} -fh`.split($/) + + output = %w[ + 1234567:h + 12345:he + 1:hell + 123:hello + ] + assert_equal output, `cat #{tempname} | #{FZF} -fh -n2 -d:`.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' } |