diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-06-26 22:33:58 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-06-26 22:33:58 +0900 |
| commit | 79690724d8fe0dbf785f17a49e24358e0913b5ad (patch) | |
| tree | 92aa29ad3d4888defd685e8e0e5094ae59fc6674 /test | |
| parent | 5ed87ffcb920f8311cfd29dee0575e6c64755314 (diff) | |
| download | fzf-79690724d8fe0dbf785f17a49e24358e0913b5ad.tar.gz | |
Fix exact boundary match with --scheme=path or --tiebreak end
Fix #4438
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_filter.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test_filter.rb b/test/test_filter.rb index 3e604412..4a520442 100644 --- a/test/test_filter.rb +++ b/test/test_filter.rb @@ -304,11 +304,11 @@ class TestFilter < TestBase def test_boundary_match # Underscore boundaries should be ranked lower { - 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_] + default: [' xyz '] + %w[/xyz/ [xyz] -xyz- -xyz_ _xyz- _xyz_], + path: ['/xyz/', ' xyz '] + %w[[xyz] -xyz- -xyz_ _xyz- _xyz_], + history: ['[xyz]', '-xyz-', ' xyz '] + %w[/xyz/ -xyz_ _xyz- _xyz_] }.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) + result = `printf -- 'xxyzx\n-xxyz\nxyzx-\n_xyz_\n_xyz-\n-xyz_\n[xyz]\n-xyz-\n xyz \n/xyz/\n' | #{FZF} -f"'xyz'" --scheme=#{scheme}`.lines(chomp: true) assert_equal expected, result end end |
