0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.2.0292: Vim9: CHECKNR and CHECKTYPE instructions not tested

Problem:    Vim9: CHECKNR and CHECKTYPE instructions not tested.
Solution:   Add tests.
This commit is contained in:
Bram Moolenaar
2020-02-20 23:08:34 +01:00
parent 436472f5e0
commit 09f28f49c9
3 changed files with 14 additions and 0 deletions

View File

@@ -781,6 +781,11 @@ func Test_expr7_fails()
call CheckDefExecFailure("echo s:doesnt_exist", 'E121:') call CheckDefExecFailure("echo s:doesnt_exist", 'E121:')
call CheckDefExecFailure("echo g:doesnt_exist", 'E121:') call CheckDefExecFailure("echo g:doesnt_exist", 'E121:')
call CheckDefExecFailure("let x = +g:astring", 'E1030:')
call CheckDefExecFailure("let x = +g:ablob", 'E974:')
call CheckDefExecFailure("let x = +g:alist", 'E745:')
call CheckDefExecFailure("let x = +g:adict", 'E728:')
endfunc endfunc
let g:Funcrefs = [function('add')] let g:Funcrefs = [function('add')]

View File

@@ -114,9 +114,16 @@ def ReturnNumber(): number
return 123 return 123
enddef enddef
let g:notNumber = 'string'
def ReturnGlobal(): number
return g:notNumber
enddef
def Test_return_string() def Test_return_string()
assert_equal('string', ReturnString()) assert_equal('string', ReturnString())
assert_equal(123, ReturnNumber()) assert_equal(123, ReturnNumber())
assert_fails('call ReturnGlobal()', 'E1029: Expected number but got string')
enddef enddef
func Increment() func Increment()

View File

@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
292,
/**/ /**/
291, 291,
/**/ /**/