summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-11 21:45:00 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-11 21:45:00 +0100
commit5a6698169d10833abad88c98e5a332ddde5d110d (patch)
tree510105e0ac70e0ae9d64c59bfa8d6a50e381d9c8
parentec0f50a35e207e01ff54cef954313030e3ab42a6 (diff)
downloadvim-git-5a6698169d10833abad88c98e5a332ddde5d110d.tar.gz
patch 8.1.0896: tests for restricted mode no run for MS-Windows GUIv8.1.0896
Problem: Tests for restricted mode no run for MS-Windows GUI. Solution: Make tests also work in MS-Windows GUI.
-rw-r--r--src/testdir/test_restricted.vim35
-rw-r--r--src/version.c2
2 files changed, 15 insertions, 22 deletions
diff --git a/src/testdir/test_restricted.vim b/src/testdir/test_restricted.vim
index 85da94c41..a29f7c33d 100644
--- a/src/testdir/test_restricted.vim
+++ b/src/testdir/test_restricted.vim
@@ -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')))
diff --git a/src/version.c b/src/version.c
index 33353ba84..6e3c6f408 100644
--- a/src/version.c
+++ b/src/version.c
@@ -784,6 +784,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 896,
+/**/
895,
/**/
894,