]> granicus.if.org Git - vim/commitdiff
patch 8.1.0189: function defined in sandbox not tested v8.1.0189
authorBram Moolenaar <Bram@vim.org>
Sun, 15 Jul 2018 18:24:31 +0000 (20:24 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 15 Jul 2018 18:24:31 +0000 (20:24 +0200)
Problem:    Function defined in sandbox not tested.
Solution:   Add a text.

src/testdir/test_functions.vim
src/version.c

index 7efbbe8829c571a98b61cdaef446416799657299..5cfaaa0643a8dac650219332a67dceaef8554ddb 100644 (file)
@@ -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
index 892b9aea1d2dc5098fec8c23de5846373072700b..c48804cc73a408a73ac86f1748e5808ca249062b 100644 (file)
@@ -789,6 +789,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    189,
 /**/
     188,
 /**/