Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
19468:60814cbadf88 | 19469:55656a51d2af |
---|---|
112 | 112 |
113 def ReturnNumber(): number | 113 def ReturnNumber(): number |
114 return 123 | 114 return 123 |
115 enddef | 115 enddef |
116 | 116 |
117 let g:notNumber = 'string' | |
118 | |
119 def ReturnGlobal(): number | |
120 return g:notNumber | |
121 enddef | |
122 | |
117 def Test_return_string() | 123 def Test_return_string() |
118 assert_equal('string', ReturnString()) | 124 assert_equal('string', ReturnString()) |
119 assert_equal(123, ReturnNumber()) | 125 assert_equal(123, ReturnNumber()) |
126 assert_fails('call ReturnGlobal()', 'E1029: Expected number but got string') | |
120 enddef | 127 enddef |
121 | 128 |
122 func Increment() | 129 func Increment() |
123 let g:counter += 1 | 130 let g:counter += 1 |
124 endfunc | 131 endfunc |