mirror of
https://github.com/neovim/neovim.git
synced 2026-03-11 10:35:32 +10:00
Problem: Setting v:errors to wrong type still possible.
Solution: Return after giving an error message. (Christian Brabandt)
88b53fd052
24 lines
514 B
VimL
24 lines
514 B
VimL
" Tests for various eval things.
|
|
|
|
function s:foo() abort
|
|
try
|
|
return [] == 0
|
|
catch
|
|
return 1
|
|
endtry
|
|
endfunction
|
|
|
|
func Test_catch_return_with_error()
|
|
call assert_equal(1, s:foo())
|
|
endfunc
|
|
|
|
func Test_E963()
|
|
" These commands used to cause an internal error prior to vim 8.1.0563
|
|
let v_e = v:errors
|
|
let v_o = v:oldfiles
|
|
call assert_fails("let v:errors=''", 'E963:')
|
|
call assert_equal(v_e, v:errors)
|
|
call assert_fails("let v:oldfiles=''", 'E963:')
|
|
call assert_equal(v_o, v:oldfiles)
|
|
endfunc
|