From 7e1d9c560b09cacb78b2fc8f9428a77d6fca66e1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 7 Nov 2022 07:21:46 +0800 Subject: vim-patch:8.2.2873: not enough tests for writing buffers Problem: Not enough tests for writing buffers. Solution: Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8229) https://github.com/vim/vim/commit/46aa6f93acb5d932d2893606d980a6b4b8a9594c Co-authored-by: Yegappan Lakshmanan --- src/nvim/testdir/test_buffer.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/nvim/testdir/test_buffer.vim') diff --git a/src/nvim/testdir/test_buffer.vim b/src/nvim/testdir/test_buffer.vim index d8d22ff872..3300278802 100644 --- a/src/nvim/testdir/test_buffer.vim +++ b/src/nvim/testdir/test_buffer.vim @@ -434,4 +434,24 @@ func Test_buf_pattern_invalid() bwipe! endfunc +" Test for the 'maxmem' and 'maxmemtot' options +func Test_buffer_maxmem() + " use 1KB per buffer and 2KB for all the buffers + " set maxmem=1 maxmemtot=2 + new + let v:errmsg = '' + " try opening some files + edit test_arglist.vim + call assert_equal('test_arglist.vim', bufname()) + edit test_eval_stuff.vim + call assert_equal('test_eval_stuff.vim', bufname()) + b test_arglist.vim + call assert_equal('test_arglist.vim', bufname()) + b test_eval_stuff.vim + call assert_equal('test_eval_stuff.vim', bufname()) + close + call assert_equal('', v:errmsg) + " set maxmem& maxmemtot& +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit