diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-08-22 22:09:53 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-22 22:09:53 +0800 |
| commit | baaaa1f2b3b6ae3a989d1362a27e55dc7b0b148a (patch) | |
| tree | e95acb31f5006385393ad8fdfe90345b1b150828 /src/nvim/testdir/test_functions.vim | |
| parent | 15a768eeb02e2af39eead1ea1eb4a5a60710d6fb (diff) | |
| download | rneovim-baaaa1f2b3b6ae3a989d1362a27e55dc7b0b148a.tar.gz rneovim-baaaa1f2b3b6ae3a989d1362a27e55dc7b0b148a.tar.bz2 rneovim-baaaa1f2b3b6ae3a989d1362a27e55dc7b0b148a.zip | |
vim-patch:8.2.3421: a bit of code is not covered by tests (#19895)
Problem: A bit of code is not covered by tests.
Solution: Add a few more test cases. (Dominique Pellé, closes vim/vim#8857)
https://github.com/vim/vim/commit/d176ca3dde47c11aae0376c31b7e1ba0939c8c6c
Cherry-pick Test_trim() change from patch 8.2.0448.
Cherry-pick Test_History() change from patch 8.2.1736.
Cherry-pick charidx() and trim() type checks from patch 8.2.3135.
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
| -rw-r--r-- | src/nvim/testdir/test_functions.vim | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index 44b6f0373e..ee63c0e1bd 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1420,12 +1420,15 @@ func Test_trim() call assert_equal("vim", trim(" vim ", " ", 0)) call assert_equal("vim ", trim(" vim ", " ", 1)) call assert_equal(" vim", trim(" vim ", " ", 2)) - call assert_fails('call trim(" vim ", " ", [])', 'E745:') - call assert_fails('call trim(" vim ", " ", -1)', 'E475:') - call assert_fails('call trim(" vim ", " ", 3)', 'E475:') + call assert_fails('eval trim(" vim ", " ", [])', 'E745:') + call assert_fails('eval trim(" vim ", " ", -1)', 'E475:') + call assert_fails('eval trim(" vim ", " ", 3)', 'E475:') + call assert_fails('eval trim(" vim ", 0)', 'E475:') let chars = join(map(range(1, 0x20) + [0xa0], {n -> n->nr2char()}), '') call assert_equal("x", trim(chars . "x" . chars)) + + call assert_fails('let c=trim([])', 'E730:') endfunc " Test for reg_recording() and reg_executing() |