1
0
forked from aniani/vim

patch 8.2.3061: testing the shell option is incomplete and spread out

Problem:    Testing the shell option is incomplete and spread out.
Solution:   Move shell tests to one file and increase coverage. (Yegappan
            Lakshmanan, closes #8464)
This commit is contained in:
Yegappan Lakshmanan
2021-06-27 12:07:49 +02:00
committed by Bram Moolenaar
parent 98f9a5f4cb
commit 054794c20f
6 changed files with 163 additions and 89 deletions

View File

@@ -144,40 +144,4 @@ func Test_system_with_shell_quote()
endtry
endfunc
" Test for 'shellxquote'
func Test_Shellxquote()
CheckUnix
let save_shell = &shell
let save_sxq = &shellxquote
let save_sxe = &shellxescape
call writefile(['#!/bin/sh', 'echo "Cmd: [$*]" > Xlog'], 'Xtestshell')
call setfperm('Xtestshell', "r-x------")
set shell=./Xtestshell
set shellxquote=\\"
call feedkeys(":!pwd\<CR>\<CR>", 'xt')
call assert_equal(['Cmd: [-c "pwd"]'], readfile('Xlog'))
set shellxquote=(
call feedkeys(":!pwd\<CR>\<CR>", 'xt')
call assert_equal(['Cmd: [-c (pwd)]'], readfile('Xlog'))
set shellxquote=\\"(
call feedkeys(":!pwd\<CR>\<CR>", 'xt')
call assert_equal(['Cmd: [-c "(pwd)"]'], readfile('Xlog'))
set shellxescape=\"&<<()@^
set shellxquote=(
call feedkeys(":!pwd\"&<<{}@^\<CR>\<CR>", 'xt')
call assert_equal(['Cmd: [-c (pwd^"^&^<^<{}^@^^)]'], readfile('Xlog'))
let &shell = save_shell
let &shellxquote = save_sxq
let &shellxescape = save_sxe
call delete('Xtestshell')
call delete('Xlog')
endfunc
" vim: shiftwidth=2 sts=2 expandtab