From 6b3775bbe27010d371c6e3f0e9df5a56d94aeaba Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 23 Mar 2019 01:26:07 -0400 Subject: [PATCH] vim-patch:8.1.0189: function defined in sandbox not tested Problem: Function defined in sandbox not tested. Solution: Add a text. https://github.com/vim/vim/commit/d90a144eda047816acffc7a8f297b43a7120710e --- src/nvim/testdir/test_functions.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index 824baffbc9..c0faf1acdc 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1049,3 +1049,19 @@ func Test_func_range_with_edit() call delete('Xfuncrange2') bwipe! 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\")} + call assert_fails('call F()', 'E48:') + unlet F + + call assert_fails('call Fsandbox()', 'E48:') + delfunc Fsandbox +endfunc