forked from aniani/vim
patch 9.1.0451: No test for escaping '<' with shellescape()
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>
This commit is contained in:
committed by
Christian Brabandt
parent
32a5faa6d7
commit
88c8c547d5
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user