changeset 14348:e73c0a0e7e87 v8.1.0189

patch 8.1.0189: function defined in sandbox not tested commit https://github.com/vim/vim/commit/d90a144eda047816acffc7a8f297b43a7120710e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 15 20:24:31 2018 +0200 patch 8.1.0189: function defined in sandbox not tested Problem: Function defined in sandbox not tested. Solution: Add a text.
author Christian Brabandt <cb@256bit.org>
date Sun, 15 Jul 2018 20:30:06 +0200
parents 723487cd7876
children 6e065a3bad97
files src/testdir/test_functions.vim src/version.c
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -984,3 +984,19 @@ func Test_libcall_libcallnr()
   call assert_fails("call libcall('Xdoesnotexist_', 'getenv', 'HOME')", 'E364:')
   call assert_fails("call libcallnr('Xdoesnotexist_', 'strlen', 'abcd')", 'E364:')
 endfunc
+
+sandbox function Fsandbox()
+  normal ix
+endfunc
+
+func Test_func_sandbox()
+  sandbox let F = {-> 'hello'}
+  call assert_equal('hello', F())
+
+  sandbox let F = {-> execute("normal ix\<Esc>")}
+  call assert_fails('call F()', 'E48:')
+  unlet F
+
+  call assert_fails('call Fsandbox()', 'E48:')
+  delfunc Fsandbox
+endfunc
--- a/src/version.c
+++ b/src/version.c
@@ -790,6 +790,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    189,
+/**/
     188,
 /**/
     187,