1
0
forked from aniani/vim

patch 8.1.0896: tests for restricted mode no run for MS-Windows GUI

Problem:    Tests for restricted mode no run for MS-Windows GUI.
Solution:   Make tests also work in MS-Windows GUI.
This commit is contained in:
Bram Moolenaar
2019-02-11 21:45:00 +01:00
parent ec0f50a35e
commit 5a6698169d
2 changed files with 15 additions and 22 deletions

View File

@@ -2,27 +2,13 @@
source shared.vim
if has('win32') && has('gui')
" Win32 GUI shows a dialog instead of displaying the error in the last line.
finish
endif
"if has('win32') && has('gui')
" " Win32 GUI shows a dialog instead of displaying the error in the last line.
" finish
"endif
func Test_restricted()
let cmd = GetVimCommand('Xrestricted')
if cmd == ''
return
endif
call writefile([
\ "silent !ls",
\ "call writefile([v:errmsg], 'Xrestrout')",
\ "qa!",
\ ], 'Xrestricted')
call system(cmd . ' -Z')
call assert_match('E145:', join(readfile('Xrestrout')))
call delete('Xrestricted')
call delete('Xrestrout')
call Run_restricted_test('!ls', 'E145:')
endfunc
func Run_restricted_test(ex_cmd, error)
@@ -31,10 +17,15 @@ func Run_restricted_test(ex_cmd, error)
return
endif
" Use a VimEnter autocommand to avoid that the error message is displayed in
" a dialog with an OK button.
call writefile([
\ a:ex_cmd,
\ "call writefile([v:errmsg], 'Xrestrout')",
\ "qa!",
\ "func Init()",
\ " silent! " . a:ex_cmd,
\ " call writefile([v:errmsg], 'Xrestrout')",
\ " qa!",
\ "endfunc",
\ "au VimEnter * call Init()",
\ ], 'Xrestricted')
call system(cmd . ' -Z')
call assert_match(a:error, join(readfile('Xrestrout')))

View File

@@ -783,6 +783,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
896,
/**/
895,
/**/