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 #8229)
diff --git a/src/testdir/test_buffer.vim b/src/testdir/test_buffer.vim
index 4e8a79f..960a760 100644
--- a/src/testdir/test_buffer.vim
+++ b/src/testdir/test_buffer.vim
@@ -381,4 +381,24 @@
   call assert_equal('OtherBuffer', bufname())
 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