summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_shell.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-05-30 19:27:25 +0200
committerChristian Brabandt <cb@256bit.org>2024-05-30 19:27:25 +0200
commit88c8c547d5fc380e5685c2b01ec564ccdf9b259a (patch)
tree4a0dfe9ddf254048b5b61a22e1f50306c808ef59 /src/testdir/test_shell.vim
parent32a5faa6d7592795c6ec77e44dc0357b92b8a681 (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/test_shell.vim')
-rw-r--r--src/testdir/test_shell.vim4
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))