diff options
| author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-05-22 19:44:53 +0100 |
|---|---|---|
| committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-09-11 15:33:20 +0100 |
| commit | 6617629ad6eceeb77d49633780a7213eeb17a2c9 (patch) | |
| tree | 9788c7d628daf61d19466d64d1bdec9279b3dc39 /src/nvim/testdir/test_eval_stuff.vim | |
| parent | dda977f5c4d2fc81a0582fbaec7a6397aaf7aebf (diff) | |
| download | rneovim-6617629ad6eceeb77d49633780a7213eeb17a2c9.tar.gz rneovim-6617629ad6eceeb77d49633780a7213eeb17a2c9.tar.bz2 rneovim-6617629ad6eceeb77d49633780a7213eeb17a2c9.zip | |
vim-patch:8.1.2035: recognizing octal numbers is confusing
Problem: Recognizing octal numbers is confusing.
Solution: Introduce scriptversion 4: do not use octal and allow for single
quote inside numbers.
https://github.com/vim/vim/commit/60a8de28d11595f4df0419ece8afa7d6accc9fbd
:scriptversion is N/A.
Cherry-pick Test_readfile_binary() from v8.1.0742.
Note that this patch was missing vim_str2nr() changes, and so fails the
tests; this was fixed in v8.1.2036.
Diffstat (limited to 'src/nvim/testdir/test_eval_stuff.vim')
| -rw-r--r-- | src/nvim/testdir/test_eval_stuff.vim | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/src/nvim/testdir/test_eval_stuff.vim b/src/nvim/testdir/test_eval_stuff.vim index 4870b9a60a..084c856ba0 100644 --- a/src/nvim/testdir/test_eval_stuff.vim +++ b/src/nvim/testdir/test_eval_stuff.vim @@ -33,6 +33,24 @@ func Test_for_invalid() redraw endfunc +func Test_readfile_binary() + new + call setline(1, ['one', 'two', 'three']) + setlocal ff=dos + silent write XReadfile + let lines = readfile('XReadfile') + call assert_equal(['one', 'two', 'three'], lines) + let lines = readfile('XReadfile', '', 2) + call assert_equal(['one', 'two'], lines) + let lines = readfile('XReadfile', 'b') + call assert_equal(["one\r", "two\r", "three\r", ""], lines) + let lines = readfile('XReadfile', 'b', 2) + call assert_equal(["one\r", "two\r"], lines) + + bwipe! + call delete('XReadfile') +endfunc + func Test_mkdir_p() call mkdir('Xmkdir/nested', 'p') call assert_true(isdirectory('Xmkdir/nested')) @@ -90,6 +108,15 @@ func Test_string_concatenation() call assert_equal('ab', a) endfunc +" Test fix for issue #4507 +func Test_skip_after_throw() + try + throw 'something' + let x = wincol() || &ts + catch /something/ + endtry +endfunc + func Test_nocatch_restore_silent_emsg() silent! try throw 1 @@ -111,15 +138,6 @@ func Test_let_errmsg() let v:errmsg = '' endfunc -" Test fix for issue #4507 -func Test_skip_after_throw() - try - throw 'something' - let x = wincol() || &ts - catch /something/ - endtry -endfunc - func Test_number_max_min_size() " This will fail on systems without 64 bit number support or when not " configured correctly. |