diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2023-05-08 15:31:38 +0100 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2023-05-08 15:31:38 +0100 |
| commit | 8cf51376b842e0060edf08bd2e5bd9933c552ecf (patch) | |
| tree | e98edb7a30d0b40eacbd0281313621351ac9d055 /src/testdir/test_functions.vim | |
| parent | 276410e78f0b82e3123059383994d2f4c578dfbd (diff) | |
| download | vim-git-9.0.1524.tar.gz | |
patch 9.0.1524: passing -1 for bool is not always rejectedv9.0.1524
Problem: Passing -1 for bool is not always rejected.
Solution: Check for error in a better way. (closes #12358)
Diffstat (limited to 'src/testdir/test_functions.vim')
| -rw-r--r-- | src/testdir/test_functions.vim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index f05ac15ed..4529a5e8d 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -1225,6 +1225,7 @@ func Test_byteidx() call assert_fails("call byteidx([], 0)", 'E730:') call assert_fails("call byteidx('abc', [])", 'E745:') call assert_fails("call byteidx('abc', 0, {})", ['E728:', 'E728:']) + call assert_fails("call byteidx('abc', 0, -1)", ['E1023:', 'E1023:']) endfunc " Test for byteidxcomp() using a character index @@ -1265,6 +1266,7 @@ func Test_byteidxcomp() call assert_fails("call byteidxcomp([], 0)", 'E730:') call assert_fails("call byteidxcomp('abc', [])", 'E745:') call assert_fails("call byteidxcomp('abc', 0, {})", ['E728:', 'E728:']) + call assert_fails("call byteidxcomp('abc', 0, -1)", ['E1023:', 'E1023:']) endfunc " Test for byteidx() using a UTF-16 index @@ -1625,7 +1627,6 @@ func Test_utf16idx_from_charidx() " error cases call assert_equal(-1, utf16idx(test_null_string(), 0, v:true, v:true)) call assert_fails('let l = utf16idx("ab", 0, v:false, [])', 'E1212:') - call assert_fails('echo strchars("", {})', ['E728:', 'E728:']) endfunc " Test for strutf16len() |
