test/old: partial port of patch 8.1.0736

Required for patch 8.1.2264.
This commit is contained in:
Jan Edmund Lazo 2020-11-30 01:11:22 -05:00
parent b3ddc23507
commit 8562c2cb6b
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
2 changed files with 12 additions and 4 deletions

View File

@ -3694,7 +3694,7 @@ endif
if ExtraVim(msgfile) if ExtraVim(msgfile)
try try
Xpath 4194304 " X: 4194304 Xpath 4194304 " X: 4194304
let x = novar " error E121/E15; exception: E121 let x = novar " error E121; exception: E121
catch /E15:/ " should not catch catch /E15:/ " should not catch
Xpath 8388608 " X: 0 Xpath 8388608 " X: 0
endtry endtry
@ -3702,7 +3702,7 @@ if ExtraVim(msgfile)
endif endif
Xpath 33554432 " X: 33554432 Xpath 33554432 " X: 33554432
if !MESSAGES('E121', "Undefined variable", 'E15', "Invalid expression") if !MESSAGES('E121', "Undefined variable")
Xpath 67108864 " X: 0 Xpath 67108864 " X: 0
endif endif

View File

@ -25,11 +25,11 @@ func Test_let_termcap()
let &t_k1 = old_t_k1 let &t_k1 = old_t_k1
endif endif
call assert_fails('let x = &t_xx', 'E15') call assert_fails('let x = &t_xx', 'E113')
let &t_xx = "yes" let &t_xx = "yes"
call assert_equal("yes", &t_xx) call assert_equal("yes", &t_xx)
let &t_xx = "" let &t_xx = ""
call assert_fails('let x = &t_xx', 'E15') call assert_fails('let x = &t_xx', 'E113')
endfunc endfunc
func Test_let_option_error() func Test_let_option_error()
@ -45,3 +45,11 @@ func Test_let_option_error()
call assert_equal("vert:|", &fillchars) call assert_equal("vert:|", &fillchars)
let &fillchars = _w let &fillchars = _w
endfunc endfunc
func Test_let_errors()
let s = 'abcd'
call assert_fails('let s[1] = 5', 'E689:')
let l = [1, 2, 3]
call assert_fails('let l[:] = 5', 'E709:')
endfunc