1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
From: Bram Moolenaar <Bram@vim.org>
Date: Sun, 15 Jul 2018 20:24:31 +0200
Subject: patch 8.1.0189: function defined in sandbox not tested
Problem: Function defined in sandbox not tested.
Solution: Add a text.
(cherry picked from commit d90a144eda047816acffc7a8f297b43a7120710e)
Signed-off-by: James McCoy <jamessan@debian.org>
---
src/testdir/test_functions.vim | 16 ++++++++++++++++
src/version.c | 2 ++
2 files changed, 18 insertions(+)
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index ec816d1..1bbfc37 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -16,3 +16,19 @@ func Test_str2nr()
call assert_equal(123456789, str2nr('123456789'))
call assert_equal(-123456789, str2nr('-123456789'))
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
diff --git a/src/version.c b/src/version.c
index 8bc64f9..56a66d2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -1195,6 +1195,8 @@ static int included_patches[] =
*/
static char *(extra_patches[]) =
{ /* Add your patch description below this line */
+/**/
+ "8.1.0189",
/**/
"8.1.0177",
/**/
|