diff src/testdir/test_vim9_script.vim @ 19469:55656a51d2af v8.2.0292

patch 8.2.0292: Vim9: CHECKNR and CHECKTYPE instructions not tested Commit: https://github.com/vim/vim/commit/09f28f49c9b5973593f8a9b445cdc2ed3da630b6 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 20 23:08:34 2020 +0100 patch 8.2.0292: Vim9: CHECKNR and CHECKTYPE instructions not tested Problem: Vim9: CHECKNR and CHECKTYPE instructions not tested. Solution: Add tests.
author Bram Moolenaar <Bram@vim.org>
date Thu, 20 Feb 2020 23:15:03 +0100
parents f41e46f02c8c
children b09afbebffee
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -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()