aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-29 17:55:39 +0800
committerGitHub <noreply@github.com>2022-11-29 17:55:39 +0800
commit89f0987bde8124f8fcbbcbf8320dbdabe0d69ba9 (patch)
tree2c6df56636b27cb2e19c5da47a843c099e51975f /src/nvim/testdir
parent0b79137c59fbe44bded76f123602e552dc6f7b03 (diff)
parent05f7d2badead3ba399578c2392e1d9b790df475d (diff)
downloadrneovim-89f0987bde8124f8fcbbcbf8320dbdabe0d69ba9.tar.gz
rneovim-89f0987bde8124f8fcbbcbf8320dbdabe0d69ba9.tar.bz2
rneovim-89f0987bde8124f8fcbbcbf8320dbdabe0d69ba9.zip
Merge pull request #21232 from zeertzjq/vim-9.0.0910
vim-patch:9.0.{0910,0914}
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_bufline.vim26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_bufline.vim b/src/nvim/testdir/test_bufline.vim
index d4dee38620..0468025f55 100644
--- a/src/nvim/testdir/test_bufline.vim
+++ b/src/nvim/testdir/test_bufline.vim
@@ -98,12 +98,25 @@ func Test_appendbufline()
new
let b = bufnr('%')
hide
+
+ new
+ call setline(1, ['line1', 'line2', 'line3'])
+ normal! 2gggg
+ call assert_equal(2, line("''"))
+
call assert_equal(0, appendbufline(b, 0, ['foo', 'bar']))
call assert_equal(['foo'], getbufline(b, 1))
call assert_equal(['bar'], getbufline(b, 2))
call assert_equal(['foo', 'bar'], getbufline(b, 1, 2))
+ call assert_equal(0, appendbufline(b, 0, 'baz'))
+ call assert_equal(['baz', 'foo', 'bar'], getbufline(b, 1, 3))
+
+ " appendbufline() in a hidden buffer shouldn't move marks in current window.
+ call assert_equal(2, line("''"))
+ bwipe!
+
exe "bd!" b
- call assert_equal([], getbufline(b, 1, 2))
+ call assert_equal([], getbufline(b, 1, 3))
split Xtest
call setline(1, ['a', 'b', 'c'])
@@ -145,10 +158,21 @@ func Test_deletebufline()
let b = bufnr('%')
call setline(1, ['aaa', 'bbb', 'ccc'])
hide
+
+ new
+ call setline(1, ['line1', 'line2', 'line3'])
+ normal! 2gggg
+ call assert_equal(2, line("''"))
+
call assert_equal(0, deletebufline(b, 2))
call assert_equal(['aaa', 'ccc'], getbufline(b, 1, 2))
call assert_equal(0, deletebufline(b, 2, 8))
call assert_equal(['aaa'], getbufline(b, 1, 2))
+
+ " deletebufline() in a hidden buffer shouldn't move marks in current window.
+ call assert_equal(2, line("''"))
+ bwipe!
+
exe "bd!" b
call assert_equal(1, b->deletebufline(1))