aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/old/testdir/test_functions.vim48
-rw-r--r--test/old/testdir/test_options.vim29
-rw-r--r--test/old/testdir/test_shell.vim23
3 files changed, 23 insertions, 77 deletions
diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim
index 18d0d9aa5d..fa9ae63381 100644
--- a/test/old/testdir/test_functions.vim
+++ b/test/old/testdir/test_functions.vim
@@ -2143,54 +2143,6 @@ func Test_balloon_show()
endif
endfunc
-func Test_shellescape()
- let save_shell = &shell
- set shell=bash
- call assert_equal("'text'", shellescape('text'))
- call assert_equal("'te\"xt'", 'te"xt'->shellescape())
- call assert_equal("'te'\\''xt'", shellescape("te'xt"))
-
- call assert_equal("'te%xt'", shellescape("te%xt"))
- 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!xt'", shellescape("te!xt"))
- call assert_equal("'te\\!xt'", shellescape("te!xt", 1))
-
- call assert_equal("'te\nxt'", shellescape("te\nxt"))
- call assert_equal("'te\\\nxt'", shellescape("te\nxt", 1))
- set shell=tcsh
- call assert_equal("'te\\!xt'", shellescape("te!xt"))
- call assert_equal("'te\\\\!xt'", shellescape("te!xt", 1))
- call assert_equal("'te\\\nxt'", shellescape("te\nxt"))
- call assert_equal("'te\\\\\nxt'", shellescape("te\nxt", 1))
-
- set shell=fish
- call assert_equal("'text'", shellescape('text'))
- call assert_equal("'te\"xt'", shellescape('te"xt'))
- call assert_equal("'te'\\''xt'", shellescape("te'xt"))
-
- call assert_equal("'te%xt'", shellescape("te%xt"))
- 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!xt'", shellescape("te!xt"))
- 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\\\\'\\''xt'", shellescape("te\\'xt"))
- 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\\\\%xt'", shellescape("te\\%xt"))
- 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))
-
- let &shell = save_shell
-endfunc
-
func Test_setbufvar_options()
" This tests that aucmd_prepbuf() and aucmd_restbuf() properly restore the
" window layout and cursor position.
diff --git a/test/old/testdir/test_options.vim b/test/old/testdir/test_options.vim
index 7786f82af2..8ffd8f7ef8 100644
--- a/test/old/testdir/test_options.vim
+++ b/test/old/testdir/test_options.vim
@@ -1400,35 +1400,6 @@ func Test_buftype()
bwipe!
endfunc
-" Test for the 'shell' option
-func Test_shell()
- throw 'Skipped: Nvim does not have :shell'
- CheckUnix
- let save_shell = &shell
- set shell=
- let caught_e91 = 0
- try
- shell
- catch /E91:/
- let caught_e91 = 1
- endtry
- call assert_equal(1, caught_e91)
- let &shell = save_shell
-endfunc
-
-" Test for the 'shellquote' option
-func Test_shellquote()
- CheckUnix
- set shellquote=#
- set verbose=20
- redir => v
- silent! !echo Hello
- redir END
- set verbose&
- set shellquote&
- call assert_match(': "#echo Hello#"', v)
-endfunc
-
" Test for the 'rightleftcmd' option
func Test_rightleftcmd()
CheckFeature rightleft
diff --git a/test/old/testdir/test_shell.vim b/test/old/testdir/test_shell.vim
index c50161a8ed..baaa327965 100644
--- a/test/old/testdir/test_shell.vim
+++ b/test/old/testdir/test_shell.vim
@@ -128,6 +128,29 @@ func Test_shellescape()
call assert_equal("'te\\\nxt'", shellescape("te\nxt"))
call assert_equal("'te\\\\\nxt'", shellescape("te\nxt", 1))
+ set shell=fish
+ call assert_equal("'text'", shellescape('text'))
+ call assert_equal("'te\"xt'", shellescape('te"xt'))
+ call assert_equal("'te'\\''xt'", shellescape("te'xt"))
+
+ call assert_equal("'te%xt'", shellescape("te%xt"))
+ 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!xt'", shellescape("te!xt"))
+ 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\\\\'\\''xt'", shellescape("te\\'xt"))
+ 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\\\\%xt'", shellescape("te\\%xt"))
+ 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))
+
let &shell = save_shell
endfunc