mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 00:03:39 -05:00
Inverse-only matches should not reorder the remaining results
Fix #1458
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user