diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-05-30 19:27:25 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-05-30 19:27:25 +0200 |
commit | 88c8c547d5fc380e5685c2b01ec564ccdf9b259a (patch) | |
tree | 4a0dfe9ddf254048b5b61a22e1f50306c808ef59 /src/testdir | |
parent | 32a5faa6d7592795c6ec77e44dc0357b92b8a681 (diff) |
patch 9.1.0451: No test for escaping '<' with shellescape()v9.1.0451
Problem: No test for escaping '<' with shellescape()
Solution: Add a test. Use memcpy() in code to make it easier to
understand. Fix a typo (zeertzjq).
closes: #14876
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_shell.vim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/testdir/test_shell.vim b/src/testdir/test_shell.vim index 7d91dff358..2ac559676f 100644 --- a/src/testdir/test_shell.vim +++ b/src/testdir/test_shell.vim @@ -158,6 +158,10 @@ func Test_shellescape() call assert_equal("'te\\#xt'", shellescape("te#xt", 1)) call assert_equal("'te!xt'", shellescape("te!xt")) call assert_equal("'te\\!xt'", shellescape("te!xt", 1)) + call assert_equal("'te<cword>xt'", shellescape("te<cword>xt")) + call assert_equal("'te\\<cword>xt'", shellescape("te<cword>xt", 1)) + call assert_equal("'te<cword>%xt'", shellescape("te<cword>%xt")) + call assert_equal("'te\\<cword>\\%xt'", shellescape("te<cword>%xt", 1)) call assert_equal("'te\nxt'", shellescape("te\nxt")) call assert_equal("'te\\\nxt'", shellescape("te\nxt", 1)) |