diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-03-18 19:32:26 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-03-18 19:32:26 +0100 |
commit | 8dfcce3a78ccb520cc9d09081f998091494c50bf (patch) | |
tree | 7e3412f192510c58f5a435ee66eab1d34606cdc0 /src/testdir/test_const.vim | |
parent | 3cdcb090a664e182078f7cc0ca3e4e5a94bbb784 (diff) |
patch 8.2.0401: not enough test coverage for evalvars.cv8.2.0401
Problem: Not enough test coverage for evalvars.c.
Solution: Add more tests. (Yegappan Lakshmanan, closes #5804)
Diffstat (limited to 'src/testdir/test_const.vim')
-rw-r--r-- | src/testdir/test_const.vim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testdir/test_const.vim b/src/testdir/test_const.vim index 7f950910b3..a0f919e45e 100644 --- a/src/testdir/test_const.vim +++ b/src/testdir/test_const.vim @@ -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 |