Mercurial > vim
diff src/testdir/test_functions.vim @ 19689:da98d2ed8dc5 v8.2.0401
patch 8.2.0401: not enough test coverage for evalvars.c
Commit: https://github.com/vim/vim/commit/8dfcce3a78ccb520cc9d09081f998091494c50bf
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Mar 18 19:32:26 2020 +0100
patch 8.2.0401: not enough test coverage for evalvars.c
Problem: Not enough test coverage for evalvars.c.
Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5804)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 18 Mar 2020 19:45:04 +0100 |
parents | b38d73f36467 |
children | b3e93a05c3ca |
line wrap: on
line diff
--- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -800,6 +800,10 @@ func Test_getbufvar() call assert_equal(0, getbufvar(bnr, '&autoindent')) call assert_equal(0, getbufvar(bnr, '&autoindent', 1)) + " Set and get a buffer-local variable + call setbufvar(bnr, 'bufvar_test', ['one', 'two']) + call assert_equal(['one', 'two'], getbufvar(bnr, 'bufvar_test')) + " Open new window with forced option values set fileformats=unix,dos new ++ff=dos ++bin ++enc=iso-8859-2 @@ -1498,6 +1502,10 @@ func Test_func_sandbox() call assert_fails('call Fsandbox()', 'E48:') delfunc Fsandbox + + " From a sandbox try to set a predefined variable (which cannot be modified + " from a sandbox) + call assert_fails('sandbox let v:lnum = 10', 'E794:') endfunc func EditAnotherFile() @@ -2030,14 +2038,6 @@ func Test_range() " sort() call assert_equal([0, 1, 2, 3, 4, 5], sort(range(5, 0, -1))) - " 'spellsuggest' - func MySuggest() - return range(3) - endfunc - set spell spellsuggest=expr:MySuggest() - call assert_equal([], spellsuggest('baord', 3)) - set nospell spellsuggest& - " string() call assert_equal('[0, 1, 2, 3, 4]', string(range(5)))