]> granicus.if.org Git - vim/commitdiff
patch 8.2.0292: Vim9: CHECKNR and CHECKTYPE instructions not tested v8.2.0292
authorBram Moolenaar <Bram@vim.org>
Thu, 20 Feb 2020 22:08:34 +0000 (23:08 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 20 Feb 2020 22:08:34 +0000 (23:08 +0100)
Problem:    Vim9: CHECKNR and CHECKTYPE instructions not tested.
Solution:   Add tests.

src/testdir/test_vim9_expr.vim
src/testdir/test_vim9_script.vim
src/version.c

index fabbd9b82bc1d55993e003e06e30838c64d794a0..312d6338c2d15c48fdb5603297ae9f869aa67673 100644 (file)
@@ -781,6 +781,11 @@ func Test_expr7_fails()
 
   call CheckDefExecFailure("echo s: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
 
 let g:Funcrefs = [function('add')]
index 6ae4273b90da8576627a2f29065ccfc02cfad420..f7205b3d5c57a32981aa84db9a1e8077f1924833 100644 (file)
@@ -114,9 +114,16 @@ def ReturnNumber(): number
   return 123
 enddef
 
+let g:notNumber = 'string'
+
+def ReturnGlobal(): number
+  return g:notNumber
+enddef
+
 def Test_return_string()
   assert_equal('string', ReturnString())
   assert_equal(123, ReturnNumber())
+  assert_fails('call ReturnGlobal()', 'E1029: Expected number but got string')
 enddef
 
 func Increment()
index 3cab8b02aa44fa49a525c5ab8b668e3b01a4d5ab..8aca2769a0ada2378ea3e05718e1385448117918 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    292,
 /**/
     291,
 /**/