comparison src/testdir/test_let.vim @ 19724:b3e93a05c3ca v8.2.0418

patch 8.2.0418: code in eval.c not sufficiently covered by tests Commit: https://github.com/vim/vim/commit/8b633135106dda8605463b780573c45b00c22afe Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 20 18:20:51 2020 +0100 patch 8.2.0418: code in eval.c not sufficiently covered by tests Problem: Code in eval.c not sufficiently covered by tests. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5815)
author Bram Moolenaar <Bram@vim.org>
date Fri, 20 Mar 2020 18:30:05 +0100
parents da98d2ed8dc5
children 0b35a7ffceb2
comparison
equal deleted inserted replaced
19723:16aa117306ec 19724:b3e93a05c3ca
273 call assert_fails('let $FOO[1] = "abc"', 'E18:') 273 call assert_fails('let $FOO[1] = "abc"', 'E18:')
274 call assert_fails('let &buftype[1] = "nofile"', 'E18:') 274 call assert_fails('let &buftype[1] = "nofile"', 'E18:')
275 let s = "var" 275 let s = "var"
276 let var = 1 276 let var = 1
277 call assert_fails('let {s}.1 = 2', 'E18:') 277 call assert_fails('let {s}.1 = 2', 'E18:')
278 call assert_fails('let a[1] = 5', 'E121:')
279 let l = [[1,2]]
280 call assert_fails('let l[:][0] = [5]', 'E708:')
281 let d = {'k' : 4}
282 call assert_fails('let d.# = 5', 'E713:')
283 call assert_fails('let d.m += 5', 'E734:')
284 let l = [1, 2]
285 call assert_fails('let l[2] = 0', 'E684:')
286 call assert_fails('let l[0:1] = [1, 2, 3]', 'E710:')
287 call assert_fails('let l[-2:-3] = [3, 4]', 'E684:')
288 call assert_fails('let l[0:4] = [5, 6]', 'E711:')
278 289
279 " This test works only when the language is English 290 " This test works only when the language is English
280 if v:lang == "C" || v:lang =~ '^[Ee]n' 291 if v:lang == "C" || v:lang =~ '^[Ee]n'
281 call assert_fails('let [a ; b;] = [10, 20]', 292 call assert_fails('let [a ; b;] = [10, 20]',
282 \ 'Double ; in list of variables') 293 \ 'Double ; in list of variables')