diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2017-08-10 12:40:53 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-08-10 12:40:53 +0900 |
commit | 6b18b144cf0a608433009515cddef74737bfce56 (patch) | |
tree | 33bf23b8eb698717dad678cfcedc6841f9870c59 /test | |
parent | 6d53089cc1857255be7f7a33c139128c092d6f9b (diff) |
Fix escaping of meta characters after ' or ! prefix
https://github.com/junegunn/fzf/issues/444#issuecomment-321432803
Diffstat (limited to 'test')
-rw-r--r-- | test/test_go.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb index 3460f56b..f8bd6b0c 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -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 |