diff src/testdir/test_bufline.vim @ 14826:75d474a8868a v8.1.0425

patch 8.1.0425: ml_get error and crash with appendbufline() commit https://github.com/vim/vim/commit/9cea87c5775948a35098f3602746c20ecf95dbcd Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 21 16:59:45 2018 +0200 patch 8.1.0425: ml_get error and crash with appendbufline() Problem: ml_get error and crash with appendbufline(). (Masashi Iizuka) Solution: Set per-window buffer info. (Hirohito Higashi, closes https://github.com/vim/vim/issues/3455)
author Christian Brabandt <cb@256bit.org>
date Fri, 21 Sep 2018 17:00:06 +0200
parents cbad3b3f46b2
children a3b5cbd2effe
line wrap: on
line diff
--- a/src/testdir/test_bufline.vim
+++ b/src/testdir/test_bufline.vim
@@ -91,6 +91,33 @@ func Test_appendbufline()
   exe "bwipe! " . b
 endfunc
 
+func Test_appendbufline_no_E315()
+  let after = [
+    \ 'set stl=%f ls=2',
+    \ 'new',
+    \ 'let buf = bufnr("%")',
+    \ 'quit',
+    \ 'vsp',
+    \ 'exec "buffer" buf',
+    \ 'wincmd w',
+    \ 'call appendbufline(buf, 0, "abc")',
+    \ 'redraw',
+    \ 'while getbufline(buf, 1)[0] =~ "^\\s*$"',
+    \ '  sleep 10m',
+    \ 'endwhile',
+    \ 'au VimLeavePre * call writefile([v:errmsg], "Xerror")',
+    \ 'au VimLeavePre * call writefile(["done"], "Xdone")',
+    \ 'qall!',
+    \ ]
+  if !RunVim([], after, '--clean')
+    return
+  endif
+  call assert_notmatch("^E315:", readfile("Xerror")[0])
+  call assert_equal("done", readfile("Xdone")[0])
+  call delete("Xerror")
+  call delete("Xdone")
+endfunc
+
 func Test_deletebufline()
   new
   let b = bufnr('%')