Mercurial > vim
comparison src/testdir/test_tabpage.vim @ 28289:cdaff4db7760 v8.2.4670
patch 8.2.4670: memory allocation failures for new tab page not tested
Commit: https://github.com/vim/vim/commit/72bb47e38f6805050ed6d969f17591bed71f83d4
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Sun Apr 3 11:22:38 2022 +0100
patch 8.2.4670: memory allocation failures for new tab page not tested
Problem: Memory allocation failures for new tab page not tested.
Solution: Add tests with failing memory allocation. (Yegappan Lakshmanan,
closes #10067)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 03 Apr 2022 12:30:03 +0200 |
parents | 93f90f2ff4e9 |
children | 13b02c1ea0f7 |
comparison
equal
deleted
inserted
replaced
28288:a044daf370c5 | 28289:cdaff4db7760 |
---|---|
850 call assert_equal(wnum, win_getid()) | 850 call assert_equal(wnum, win_getid()) |
851 | 851 |
852 tabonly! | 852 tabonly! |
853 endfunc | 853 endfunc |
854 | 854 |
855 " Test for tabpage allocation failure | |
856 func Test_tabpage_alloc_failure() | |
857 call test_alloc_fail(GetAllocId('newtabpage_tvars'), 0, 0) | |
858 call assert_fails('tabnew', 'E342:') | |
859 | |
860 call test_alloc_fail(GetAllocId('newtabpage_tvars'), 0, 0) | |
861 edit Xfile1 | |
862 call assert_fails('tabedit Xfile2', 'E342:') | |
863 call assert_equal(1, winnr('$')) | |
864 call assert_equal(1, tabpagenr('$')) | |
865 call assert_equal('Xfile1', @%) | |
866 | |
867 new | |
868 call test_alloc_fail(GetAllocId('newtabpage_tvars'), 0, 0) | |
869 call assert_fails('wincmd T', 'E342:') | |
870 bw! | |
871 | |
872 call test_alloc_fail(GetAllocId('newtabpage_tvars'), 0, 0) | |
873 call assert_fails('tab split', 'E342:') | |
874 call assert_equal(2, winnr('$')) | |
875 call assert_equal(1, tabpagenr('$')) | |
876 endfunc | |
877 | |
855 " vim: shiftwidth=2 sts=2 expandtab | 878 " vim: shiftwidth=2 sts=2 expandtab |