mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-17 15:53:39 -05:00
Test cases for non-default --scheme options
This commit is contained in:
@@ -3369,10 +3369,14 @@ class TestGoFZF < TestBase
|
||||
|
||||
def test_boundary_match
|
||||
# Underscore boundaries should be ranked lower
|
||||
assert_equal(
|
||||
%w[[x] -x- -x_ _x- _x_],
|
||||
`printf -- 'xxx\n-xx\nxx-\n_x_\n_x-\n-x_\n[x]\n-x-\n' | #{FZF} -f"'x'"`.lines(chomp: true)
|
||||
)
|
||||
{
|
||||
default: [' x '] + %w[/x/ [x] -x- -x_ _x- _x_],
|
||||
path: ['/x/', ' x '] + %w[[x] -x- -x_ _x- _x_],
|
||||
history: ['[x]', '-x-', ' x '] + %w[/x/ -x_ _x- _x_]
|
||||
}.each do |scheme, expected|
|
||||
result = `printf -- 'xxx\n-xx\nxx-\n_x_\n_x-\n-x_\n[x]\n-x-\n x \n/x/\n' | #{FZF} -f"'x'" --scheme=#{scheme}`.lines(chomp: true)
|
||||
assert_equal expected, result
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user