Mercurial > vim
comparison src/testdir/test_vim9_builtin.vim @ 23276:b79cdad3ea2e v8.2.2184
patch 8.2.2184: Vim9: no error when using "2" for a line number
Commit: https://github.com/vim/vim/commit/9a963377b4811e4e0419ec8825856ff4b01331ac
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Dec 21 21:58:46 2020 +0100
patch 8.2.2184: Vim9: no error when using "2" for a line number
Problem: Vim9: no error when using "2" for a line number.
Solution: Give an error message if the line number is invalid. (closes https://github.com/vim/vim/issues/7492)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 21 Dec 2020 22:00:03 +0100 |
parents | d7294a6220ac |
children | 9b86957ddd95 |
comparison
equal
deleted
inserted
replaced
23275:cd907d92a6be | 23276:b79cdad3ea2e |
---|---|
181 enddef | 181 enddef |
182 | 182 |
183 def Test_count() | 183 def Test_count() |
184 count('ABC ABC ABC', 'b', true)->assert_equal(3) | 184 count('ABC ABC ABC', 'b', true)->assert_equal(3) |
185 count('ABC ABC ABC', 'b', false)->assert_equal(0) | 185 count('ABC ABC ABC', 'b', false)->assert_equal(0) |
186 enddef | |
187 | |
188 def Test_cursor() | |
189 new | |
190 setline(1, range(4)) | |
191 cursor(2, 1) | |
192 assert_equal(2, getcurpos()[1]) | |
193 cursor('$', 1) | |
194 assert_equal(4, getcurpos()[1]) | |
195 | |
196 var lines =<< trim END | |
197 cursor('2', 1) | |
198 END | |
199 CheckDefExecAndScriptFailure(lines, 'E475:') | |
186 enddef | 200 enddef |
187 | 201 |
188 def Test_executable() | 202 def Test_executable() |
189 assert_false(executable("")) | 203 assert_false(executable("")) |
190 assert_false(executable(test_null_string())) | 204 assert_false(executable(test_null_string())) |