aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_buffer.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-02-28 21:01:36 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-02-28 21:17:42 +0800
commit1e513fd112767e57f2b39dfaa395c83cb4f6a9f7 (patch)
tree9f2b1d8e1c550ad8de0a54d20251014f81aa1883 /src/nvim/testdir/test_buffer.vim
parent65af4241996021b2067d2adc97cc2c83c616cbb6 (diff)
downloadrneovim-1e513fd112767e57f2b39dfaa395c83cb4f6a9f7.tar.gz
rneovim-1e513fd112767e57f2b39dfaa395c83cb4f6a9f7.tar.bz2
rneovim-1e513fd112767e57f2b39dfaa395c83cb4f6a9f7.zip
vim-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 vim/vim#10067) https://github.com/vim/vim/commit/72bb47e38f6805050ed6d969f17591bed71f83d4 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src/nvim/testdir/test_buffer.vim')
-rw-r--r--src/nvim/testdir/test_buffer.vim26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nvim/testdir/test_buffer.vim b/src/nvim/testdir/test_buffer.vim
index 90e97ae167..98eba83f73 100644
--- a/src/nvim/testdir/test_buffer.vim
+++ b/src/nvim/testdir/test_buffer.vim
@@ -451,51 +451,51 @@ func Test_buffer_maxmem()
" set maxmem& maxmemtot&
endfunc
-" Test for a allocation failure when adding a new buffer
+" Test for buffer allocation failure
func Test_buflist_alloc_failure()
CheckFunction test_alloc_fail
%bw!
edit Xfile1
- call test_alloc_fail(GetAllocId('buflistnew_bvars'), 0, 0)
+ call test_alloc_fail(GetAllocId('newbuf_bvars'), 0, 0)
call assert_fails('edit Xfile2', 'E342:')
" test for bufadd()
- call test_alloc_fail(GetAllocId('buflistnew_bvars'), 0, 0)
+ call test_alloc_fail(GetAllocId('newbuf_bvars'), 0, 0)
call assert_fails('call bufadd("Xbuffer")', 'E342:')
" test for setting the arglist
edit Xfile2
- call test_alloc_fail(GetAllocId('buflistnew_bvars'), 0, 0)
+ call test_alloc_fail(GetAllocId('newbuf_bvars'), 0, 0)
call assert_fails('next Xfile3', 'E342:')
" test for setting the alternate buffer name when writing a file
- call test_alloc_fail(GetAllocId('buflistnew_bvars'), 0, 0)
+ call test_alloc_fail(GetAllocId('newbuf_bvars'), 0, 0)
call assert_fails('write Xother', 'E342:')
call delete('Xother')
" test for creating a buffer using bufnr()
- call test_alloc_fail(GetAllocId('buflistnew_bvars'), 0, 0)
+ call test_alloc_fail(GetAllocId('newbuf_bvars'), 0, 0)
call assert_fails("call bufnr('Xnewbuf', v:true)", 'E342:')
" test for renaming buffer using :file
- call test_alloc_fail(GetAllocId('buflistnew_bvars'), 0, 0)
+ call test_alloc_fail(GetAllocId('newbuf_bvars'), 0, 0)
call assert_fails('file Xnewfile', 'E342:')
" test for creating a buffer for a popup window
- call test_alloc_fail(GetAllocId('buflistnew_bvars'), 0, 0)
+ call test_alloc_fail(GetAllocId('newbuf_bvars'), 0, 0)
call assert_fails('call popup_create("mypop", {})', 'E342:')
if has('terminal')
" test for creating a buffer for a terminal window
- call test_alloc_fail(GetAllocId('buflistnew_bvars'), 0, 0)
+ call test_alloc_fail(GetAllocId('newbuf_bvars'), 0, 0)
call assert_fails('call term_start(&shell)', 'E342:')
%bw!
endif
" test for loading a new buffer after wiping out all the buffers
edit Xfile4
- call test_alloc_fail(GetAllocId('buflistnew_bvars'), 0, 0)
+ call test_alloc_fail(GetAllocId('newbuf_bvars'), 0, 0)
call assert_fails('%bw!', 'E342:')
" test for :checktime loading the buffer
@@ -506,19 +506,19 @@ func Test_buflist_alloc_failure()
sleep 200m
call writefile(['two'], 'Xfile5')
set autoread
- call test_alloc_fail(GetAllocId('buflistnew_bvars'), 0, 0)
+ call test_alloc_fail(GetAllocId('newbuf_bvars'), 0, 0)
call assert_fails('checktime', 'E342:')
set autoread&
bw!
endif
" test for :vimgrep loading a dummy buffer
- call test_alloc_fail(GetAllocId('buflistnew_bvars'), 0, 0)
+ call test_alloc_fail(GetAllocId('newbuf_bvars'), 0, 0)
call assert_fails('vimgrep two Xfile5', 'E342:')
call delete('Xfile5')
" test for quickfix command loading a buffer
- call test_alloc_fail(GetAllocId('buflistnew_bvars'), 0, 0)
+ call test_alloc_fail(GetAllocId('newbuf_bvars'), 0, 0)
call assert_fails('cexpr "Xfile6:10:Line10"', 'E342:')
endfunc