diff options
| author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-05-30 22:50:09 +0100 |
|---|---|---|
| committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-09-11 15:33:19 +0100 |
| commit | 34cb0879551b8217db820f684d913a393f4f38cb (patch) | |
| tree | cd8c7320d91be9344cfe859c5861b475c093e565 /src/nvim/testdir | |
| parent | cd18fe17a88d8144e5b841f1ca737fb4adf7885b (diff) | |
| download | rneovim-34cb0879551b8217db820f684d913a393f4f38cb.tar.gz rneovim-34cb0879551b8217db820f684d913a393f4f38cb.tar.bz2 rneovim-34cb0879551b8217db820f684d913a393f4f38cb.zip | |
vim-patch:8.1.1355: obvious mistakes are accepted as valid expressions
Problem: Obvious mistakes are accepted as valid expressions.
Solution: Be more strict about parsing numbers. (Yasuhiro Matsumoto,
closes vim/vim#3981)
https://github.com/vim/vim/commit/16e9b85113e0b354ece1cb4f5fcc7866850f3685
Update vim_str2nr_spec.lua to add more tests that use strict = true.
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_expr.vim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index 0b41a1127a..c49285621a 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -502,6 +502,17 @@ func Test_empty_concatenate() call assert_equal('b', 'b' . 'a'[4:0]) endfunc +func Test_broken_number() + let X = 'bad' + call assert_fails('echo 1X', 'E15:') + call assert_fails('echo 0b1X', 'E15:') + call assert_fails('echo 0b12', 'E15:') + call assert_fails('echo 0x1X', 'E15:') + call assert_fails('echo 011X', 'E15:') + call assert_equal(2, str2nr('2a')) + call assert_fails('inoremap <Char-0b1z> b', 'E474:') +endfunc + func Test_eval_after_if() let s:val = '' func SetVal(x) |