aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_tabpage.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-02-28 21:55:55 +0800
committerGitHub <noreply@github.com>2023-02-28 21:55:55 +0800
commitf289fc4abb8e7c02acfd2dfc834cc6447193a67e (patch)
tree4790d7d0eb363611d524dad5b09e2687bec2a1ec /src/nvim/testdir/test_tabpage.vim
parentfaa5d5be4b998427b3378d16ea5ce6ef6f5ddfd0 (diff)
parent278aeee3aed753d1084597378e653395bd472c42 (diff)
downloadrneovim-f289fc4abb8e7c02acfd2dfc834cc6447193a67e.tar.gz
rneovim-f289fc4abb8e7c02acfd2dfc834cc6447193a67e.tar.bz2
rneovim-f289fc4abb8e7c02acfd2dfc834cc6447193a67e.zip
Merge pull request #22456 from zeertzjq/vim-9.0.0430
vim-patch:8.2.{4668,4670},9.0.0430: cannot use repeat() with a blob
Diffstat (limited to 'src/nvim/testdir/test_tabpage.vim')
-rw-r--r--src/nvim/testdir/test_tabpage.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_tabpage.vim b/src/nvim/testdir/test_tabpage.vim
index c20c798c49..db23a36dd4 100644
--- a/src/nvim/testdir/test_tabpage.vim
+++ b/src/nvim/testdir/test_tabpage.vim
@@ -846,6 +846,30 @@ func Test_lastused_tabpage()
tabonly!
endfunc
+" Test for tabpage allocation failure
+func Test_tabpage_alloc_failure()
+ CheckFunction test_alloc_fail
+ call test_alloc_fail(GetAllocId('newtabpage_tvars'), 0, 0)
+ call assert_fails('tabnew', 'E342:')
+
+ call test_alloc_fail(GetAllocId('newtabpage_tvars'), 0, 0)
+ edit Xfile1
+ call assert_fails('tabedit Xfile2', 'E342:')
+ call assert_equal(1, winnr('$'))
+ call assert_equal(1, tabpagenr('$'))
+ call assert_equal('Xfile1', @%)
+
+ new
+ call test_alloc_fail(GetAllocId('newtabpage_tvars'), 0, 0)
+ call assert_fails('wincmd T', 'E342:')
+ bw!
+
+ call test_alloc_fail(GetAllocId('newtabpage_tvars'), 0, 0)
+ call assert_fails('tab split', 'E342:')
+ call assert_equal(2, winnr('$'))
+ call assert_equal(1, tabpagenr('$'))
+endfunc
+
" this was giving ml_get errors
func Test_tabpage_last_line()
enew