comparison src/testdir/test_bufline.vim @ 16720:9c90cf08cfa8 v8.1.1362

patch 8.1.1362: code and data in tests can be hard to read commit https://github.com/vim/vim/commit/c79745a82faeb5a6058e915ca49a4c69fa60ea01 Author: Bram Moolenaar <Bram@vim.org> Date: Mon May 20 22:12:34 2019 +0200 patch 8.1.1362: code and data in tests can be hard to read Problem: Code and data in tests can be hard to read. Solution: Use the new heredoc style. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4400)
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 May 2019 22:15:06 +0200
parents 81be817c9d9a
children bfc5a2962f38
comparison
equal deleted inserted replaced
16719:27f2a2799604 16720:9c90cf08cfa8
91 call assert_equal([], getbufline(b, 6)) 91 call assert_equal([], getbufline(b, 6))
92 exe "bwipe! " . b 92 exe "bwipe! " . b
93 endfunc 93 endfunc
94 94
95 func Test_appendbufline_no_E315() 95 func Test_appendbufline_no_E315()
96 let after = [ 96 let after =<< trim [CODE]
97 \ 'set stl=%f ls=2', 97 set stl=%f ls=2
98 \ 'new', 98 new
99 \ 'let buf = bufnr("%")', 99 let buf = bufnr("%")
100 \ 'quit', 100 quit
101 \ 'vsp', 101 vsp
102 \ 'exec "buffer" buf', 102 exec "buffer" buf
103 \ 'wincmd w', 103 wincmd w
104 \ 'call appendbufline(buf, 0, "abc")', 104 call appendbufline(buf, 0, "abc")
105 \ 'redraw', 105 redraw
106 \ 'while getbufline(buf, 1)[0] =~ "^\\s*$"', 106 while getbufline(buf, 1)[0] =~ "^\\s*$"
107 \ ' sleep 10m', 107 sleep 10m
108 \ 'endwhile', 108 endwhile
109 \ 'au VimLeavePre * call writefile([v:errmsg], "Xerror")', 109 au VimLeavePre * call writefile([v:errmsg], "Xerror")
110 \ 'au VimLeavePre * call writefile(["done"], "Xdone")', 110 au VimLeavePre * call writefile(["done"], "Xdone")
111 \ 'qall!', 111 qall!
112 \ ] 112 [CODE]
113
113 if !RunVim([], after, '--clean') 114 if !RunVim([], after, '--clean')
114 return 115 return
115 endif 116 endif
116 call assert_notmatch("^E315:", readfile("Xerror")[0]) 117 call assert_notmatch("^E315:", readfile("Xerror")[0])
117 call assert_equal("done", readfile("Xdone")[0]) 118 call assert_equal("done", readfile("Xdone")[0])