diff options
| author | phanium <91544758+phanen@users.noreply.github.com> | 2025-02-21 21:21:55 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-21 22:21:55 +0900 |
| commit | 77568e114ff531f4fe14cfaeab6febd53a99b1bc (patch) | |
| tree | beef8d15922ab3a241e547a0053dc17b6e5a7769 /test | |
| parent | a24d274a3cdc680dd2d4e5664121e9727239f3b6 (diff) | |
| download | fzf-77568e114ff531f4fe14cfaeab6febd53a99b1bc.tar.gz | |
Don't trim last field when delimiter is regex (#4266)
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_core.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_core.rb b/test/test_core.rb index 0e60b57e..9328dd6c 100644 --- a/test/test_core.rb +++ b/test/test_core.rb @@ -1773,6 +1773,15 @@ class TestCore < TestInteractive end end + def test_accept_nth_regex_delimiter_strip_last + tmux.send_keys %((echo "foo:,bar:,baz"; echo "foo:,bar:,baz:,qux:,") | #{FZF} --multi --delimiter='[:,]+' --accept-nth 2.. --sync --bind 'load:select-all+accept' > #{tempname}), :Enter + wait do + assert_path_exists tempname + # Last delimiter and the whitespaces are removed + assert_equal ['bar:,baz', 'bar:,baz:,qux'], File.readlines(tempname, chomp: true) + end + end + def test_accept_nth_template tmux.send_keys %(echo "foo ,bar,baz" | #{FZF} -d, --accept-nth '1st: {1}, 3rd: {3}, 2nd: {2}' --sync --bind start:accept > #{tempname}), :Enter wait do |
