diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-12-21 21:58:46 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-12-21 21:58:46 +0100 |
commit | 9a963377b4811e4e0419ec8825856ff4b01331ac (patch) | |
tree | 239f319174f46000007c1ebd1ae76797e2fe7531 /src/testdir/test_vim9_builtin.vim | |
parent | 60f63100b9bc1d24b7b80c81f43cf2fc3da95987 (diff) |
patch 8.2.2184: Vim9: no error when using "2" for a line numberv8.2.2184
Problem: Vim9: no error when using "2" for a line number.
Solution: Give an error message if the line number is invalid. (closes #7492)
Diffstat (limited to 'src/testdir/test_vim9_builtin.vim')
-rw-r--r-- | src/testdir/test_vim9_builtin.vim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index a0504672d3..0f03d1f5c5 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -185,6 +185,20 @@ def Test_count() count('ABC ABC ABC', 'b', false)->assert_equal(0) enddef +def Test_cursor() + new + setline(1, range(4)) + cursor(2, 1) + assert_equal(2, getcurpos()[1]) + cursor('$', 1) + assert_equal(4, getcurpos()[1]) + + var lines =<< trim END + cursor('2', 1) + END + CheckDefExecAndScriptFailure(lines, 'E475:') +enddef + def Test_executable() assert_false(executable("")) assert_false(executable(test_null_string())) |