m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Fix escaping of meta characters after ' or ! prefix

https://github.com/junegunn/fzf/issues/444#issuecomment-321432803
This commit is contained in:
Junegunn Choi
2017-08-10 12:40:53 +09:00
parent 6d53089cc1
commit 6b18b144cf
2 changed files with 13 additions and 5 deletions

View File

@@ -1400,6 +1400,16 @@ class TestGoFZF < TestBase
assert_equal [], `#{FZF} -f"'br" < #{tempname}`.lines.map(&:chomp)
assert_equal ["foo'bar"], `#{FZF} -f"\\'br" < #{tempname}`.lines.map(&:chomp)
end
def test_escaped_meta_characters_only_on_relevant_positions
input = <<~EOF
\\^
^
EOF
writelines tempname, input.lines.map(&:chomp)
assert_equal %w[^ \\^], `#{FZF} -f"\\^" < #{tempname}`.lines.map(&:chomp)
assert_equal %w[\\^], `#{FZF} -f"'\\^" < #{tempname}`.lines.map(&:chomp)
end
end
module TestShell