Mercurial > vim
comparison src/testdir/test_functions.vim @ 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 | 0d534adbcc2f |
children | 0f1446193ded |
comparison
equal
deleted
inserted
replaced
14347:723487cd7876 | 14348:e73c0a0e7e87 |
---|---|
982 call assert_fails("call libcallnr(libc, 'Xdoesnotexist_', '')", 'E364:') | 982 call assert_fails("call libcallnr(libc, 'Xdoesnotexist_', '')", 'E364:') |
983 | 983 |
984 call assert_fails("call libcall('Xdoesnotexist_', 'getenv', 'HOME')", 'E364:') | 984 call assert_fails("call libcall('Xdoesnotexist_', 'getenv', 'HOME')", 'E364:') |
985 call assert_fails("call libcallnr('Xdoesnotexist_', 'strlen', 'abcd')", 'E364:') | 985 call assert_fails("call libcallnr('Xdoesnotexist_', 'strlen', 'abcd')", 'E364:') |
986 endfunc | 986 endfunc |
987 | |
988 sandbox function Fsandbox() | |
989 normal ix | |
990 endfunc | |
991 | |
992 func Test_func_sandbox() | |
993 sandbox let F = {-> 'hello'} | |
994 call assert_equal('hello', F()) | |
995 | |
996 sandbox let F = {-> execute("normal ix\<Esc>")} | |
997 call assert_fails('call F()', 'E48:') | |
998 unlet F | |
999 | |
1000 call assert_fails('call Fsandbox()', 'E48:') | |
1001 delfunc Fsandbox | |
1002 endfunc |