aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_tabpage.vim
diff options
context:
space:
mode:
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