summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2022-12-28 00:05:31 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2022-12-28 00:05:31 +0900
commit36d2bb332b87900e8178f2ec54d2cfda07f075db (patch)
tree1a5573e489b3b962920ae91ea5df374b0d1e204b /test
parent4dbe45640a46a67e2c46fcd0f6257e078b6817c1 (diff)
downloadfzf-36d2bb332b87900e8178f2ec54d2cfda07f075db.tar.gz
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} {}')
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_go.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 4b2856eb..a4d2e2a8 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -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 }