diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-02-10 20:56:54 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-10 20:56:54 -0500 |
| commit | 1aec5ba85e97889c792253424c5de9c12ddd6cf4 (patch) | |
| tree | 62c78074f611cb812eb630f6e1c88eeabeae06bd /src/nvim/testdir | |
| parent | 61aea004d7101e138794a337c03ef00a6b3994e6 (diff) | |
| parent | 81b4c881302640747de39f805312966c541acc47 (diff) | |
| download | rneovim-1aec5ba85e97889c792253424c5de9c12ddd6cf4.tar.gz rneovim-1aec5ba85e97889c792253424c5de9c12ddd6cf4.tar.bz2 rneovim-1aec5ba85e97889c792253424c5de9c12ddd6cf4.zip | |
Merge pull request #13908 from janlazo/vim-8.2.2489
vim-patch:8.1.0341,8.2.{2489,2490,2492,2495,2496}
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_arglist.vim | 18 | ||||
| -rw-r--r-- | src/nvim/testdir/test_breakindent.vim | 9 | ||||
| -rw-r--r-- | src/nvim/testdir/test_bufline.vim | 11 | ||||
| -rw-r--r-- | src/nvim/testdir/test_command_count.vim | 4 | ||||
| -rw-r--r-- | src/nvim/testdir/test_diffmode.vim | 15 |
5 files changed, 54 insertions, 3 deletions
diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim index 92fedf9bfb..a1ef8325ec 100644 --- a/src/nvim/testdir/test_arglist.vim +++ b/src/nvim/testdir/test_arglist.vim @@ -80,6 +80,24 @@ func Test_argadd() call assert_equal(0, len(argv())) endfunc +func Test_argadd_empty_curbuf() + new + let curbuf = bufnr('%') + call writefile(['test', 'Xargadd'], 'Xargadd') + " must not re-use the current buffer. + argadd Xargadd + call assert_equal(curbuf, bufnr('%')) + call assert_equal('', bufname('%')) + call assert_equal(1, line('$')) + rew + call assert_notequal(curbuf, bufnr('%')) + call assert_equal('Xargadd', bufname('%')) + call assert_equal(2, line('$')) + + %argd + bwipe! +endfunc + func Init_abc() args a b c next diff --git a/src/nvim/testdir/test_breakindent.vim b/src/nvim/testdir/test_breakindent.vim index a4c1f62a43..d53acb77d7 100644 --- a/src/nvim/testdir/test_breakindent.vim +++ b/src/nvim/testdir/test_breakindent.vim @@ -353,14 +353,19 @@ func Test_breakindent19_sbr_nextpage() " Scroll down one screen line setl scrolloff=5 norm! 5gj - redraw! let lines = s:screen_lines(1, 20) let expect = [ - \ "> aaaaaaaaaaaaaaaaaa", + \ "aaaaaaaaaaaaaaaaaaaa", \ "> aaaaaaaaaaaaaaaaaa", \ "> aaaaaaaaaaaaaaaaaa", \ ] call s:compare_lines(expect, lines) + redraw! + " moving the cursor doesn't change the text offset + norm! l + redraw! + let lines = s:screen_lines(1, 20) + call s:compare_lines(expect, lines) setl breakindent briopt=min:18 sbr=> norm! 5gj diff --git a/src/nvim/testdir/test_bufline.vim b/src/nvim/testdir/test_bufline.vim index 076f03fdd8..e038bce08e 100644 --- a/src/nvim/testdir/test_bufline.vim +++ b/src/nvim/testdir/test_bufline.vim @@ -112,6 +112,17 @@ func Test_deletebufline() call assert_equal(0, deletebufline(b, 1)) call assert_equal(['b', 'c'], getbufline(b, 1, 2)) exe "bwipe! " . b + + edit XbufOne + let one = bufnr() + call setline(1, ['a', 'b', 'c']) + setlocal nomodifiable + split XbufTwo + let two = bufnr() + call assert_fails('call deletebufline(one, 1)', 'E21:') + call assert_equal(two, bufnr()) + bwipe! XbufTwo + bwipe! XbufOne endfunc func Test_appendbufline_redraw() diff --git a/src/nvim/testdir/test_command_count.vim b/src/nvim/testdir/test_command_count.vim index 7262789ab4..55b230373f 100644 --- a/src/nvim/testdir/test_command_count.vim +++ b/src/nvim/testdir/test_command_count.vim @@ -158,7 +158,9 @@ endfunc func Test_command_count_4() %argd let bufnr = bufnr('$') - arga aa bb cc dd ee ff + next aa bb cc dd ee ff + call assert_equal(bufnr, bufnr('%')) + 3argu let args = [] .,$-argdo call add(args, expand('%')) diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim index f09a64c329..640de1bdc6 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -964,6 +964,21 @@ func Test_diff_closeoff() enew! endfunc +func Test_diff_followwrap() + new + set diffopt+=followwrap + set wrap + diffthis + call assert_equal(1, &wrap) + diffoff + set nowrap + diffthis + call assert_equal(0, &wrap) + diffoff + set diffopt& + bwipe! +endfunc + func Test_diff_rnu() CheckScreendump |