mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 22:36:09 +00:00
vim-patch:8.2.0712: various code not fully tested
Problem: Various code not fully tested.
Solution: Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#6049)
0ff5dedf0f
Nvim does not support encoding=latin1 or setting keycodes/termcaps.
This commit is contained in:
@@ -141,3 +141,41 @@ func Test_system_with_shell_quote()
|
||||
call delete('Xdir with spaces', 'rf')
|
||||
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
|
||||
|
Reference in New Issue
Block a user