diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2018-12-19 23:05:29 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2018-12-19 23:05:29 +0900 |
commit | 5624a892311e96ffe019786c5507929d9427ad0f (patch) | |
tree | 89441a7b04f50989937935bb01071c80ee6de4ff /test | |
parent | 63c42b14f24c7b82515cf13d6372dd302f5d11a5 (diff) |
Inverse-only matches should not reorder the remaining results
Fix #1458
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_go.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb index d22b8939..213f15c2 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -1519,6 +1519,19 @@ class TestGoFZF < TestBase assert_equal ['foo bar'], `#{FZF} -f'^foo\\ bar$' < #{tempname}`.lines.map(&:chomp) assert_equal input.lines.count - 1, `#{FZF} -f'!^foo\\ bar$' < #{tempname}`.lines.count end + + def test_inverse_only_search_should_not_sort_the_result + # Filter + assert_equal(%w[aaaaa b ccc], + `printf '%s\n' aaaaa b ccc BAD | #{FZF} -f '!bad'`.lines.map(&:chomp)) + + # Interactive + tmux.send_keys(%[printf '%s\n' aaaaa b ccc BAD | #{FZF} -q '!bad'], :Enter) + tmux.until { |lines| lines.item_count == 4 && lines.match_count == 3 } + tmux.until { |lines| lines[-3] == '> aaaaa' } + tmux.until { |lines| lines[-4] == ' b' } + tmux.until { |lines| lines[-5] == ' ccc' } + end end module TestShell |