mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-17 07:43:39 -05:00
Add transform-query(...) action
Test case authored by @SpicyLemon Close #1930 Close #2465 Close #2559 Close #2509 (e.g. fzf --bind 'space:transform-query:printf %s%s {q} {}')
This commit is contained in:
@@ -1797,6 +1797,15 @@ class TestGoFZF < TestBase
|
||||
tmux.until { |lines| assert_equal '> foobarbaz', lines.last }
|
||||
end
|
||||
|
||||
def test_transform_query
|
||||
tmux.send_keys %{#{FZF} --bind 'ctrl-r:transform-query(rev <<< {q}),ctrl-u:transform-query: tr "[:lower:]" "[:upper:]" <<< {q}' --query bar}, :Enter
|
||||
tmux.until { |lines| assert_equal '> bar', lines[-1] }
|
||||
tmux.send_keys 'C-r'
|
||||
tmux.until { |lines| assert_equal '> rab', lines[-1] }
|
||||
tmux.send_keys 'C-u'
|
||||
tmux.until { |lines| assert_equal '> RAB', lines[-1] }
|
||||
end
|
||||
|
||||
def test_clear_selection
|
||||
tmux.send_keys %(seq 100 | #{FZF} --multi --bind space:clear-selection), :Enter
|
||||
tmux.until { |lines| assert_equal 100, lines.match_count }
|
||||
|
||||
Reference in New Issue
Block a user