1
0
forked from aniani/vim

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 #5804)
This commit is contained in:
Bram Moolenaar
2020-03-18 19:32:26 +01:00
parent 3cdcb090a6
commit 8dfcce3a78
12 changed files with 274 additions and 12 deletions

View File

@@ -251,6 +251,14 @@ func Test_const_with_special_variables()
call assert_fails('const &filetype = "vim"', 'E996:')
call assert_fails('const &l:filetype = "vim"', 'E996:')
call assert_fails('const &g:encoding = "utf-8"', 'E996:')
call assert_fails('const [a, $CONST_FOO] = [369, "abc"]', 'E996:')
call assert_equal(369, a)
call assert_equal(v:null, getenv("CONST_FOO"))
call assert_fails('const [b; $CONST_FOO] = [246, 2, "abc"]', 'E996:')
call assert_equal(246, b)
call assert_equal(v:null, getenv("CONST_FOO"))
endfunc
func Test_const_with_eval_name()
@@ -276,3 +284,5 @@ func Test_lock_depth_is_1()
let d['bar'] = 'hello'
let d.foo = 44
endfunc
" vim: shiftwidth=2 sts=2 expandtab