Patch 8.2.0406

8 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 19, 2020, 8:55:44 AM3/19/20
to vim...@googlegroups.com

Patch 8.2.0406
Problem: FileReadCmd event not well tested.
Solution: Add a test.
Files: src/testdir/test_autocmd.vim


*** ../vim-8.2.0405/src/testdir/test_autocmd.vim 2020-03-18 21:10:41.104567492 +0100
--- src/testdir/test_autocmd.vim 2020-03-18 21:09:03.712912715 +0100
***************
*** 2408,2411 ****
--- 2408,2452 ----
bwipe!
endfunc

+ " Test for FileReadCmd autocmd
+ func Test_autocmd_FileReadCmd()
+ func ReadFileCmd()
+ call append(line('$'), "v:cmdarg = " .. v:cmdarg)
+ endfunc
+ augroup FileReadCmdTest
+ au!
+ au FileReadCmd Xtest call ReadFileCmd()
+ augroup END
+
+ new
+ read ++bin Xtest
+ read ++nobin Xtest
+ read ++edit Xtest
+ read ++bad=keep Xtest
+ read ++bad=drop Xtest
+ read ++bad=- Xtest
+ read ++ff=unix Xtest
+ read ++ff=dos Xtest
+ read ++ff=mac Xtest
+ read ++enc=utf-8 Xtest
+
+ call assert_equal(['',
+ \ 'v:cmdarg = ++bin',
+ \ 'v:cmdarg = ++nobin',
+ \ 'v:cmdarg = ++edit',
+ \ 'v:cmdarg = ++bad=keep',
+ \ 'v:cmdarg = ++bad=drop',
+ \ 'v:cmdarg = ++bad=-',
+ \ 'v:cmdarg = ++ff=unix',
+ \ 'v:cmdarg = ++ff=dos',
+ \ 'v:cmdarg = ++ff=mac',
+ \ 'v:cmdarg = ++enc=utf-8'], getline(1, '$'))
+
+ close!
+ augroup FileReadCmdTest
+ au!
+ augroup END
+ delfunc ReadFileCmd
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0405/src/version.c 2020-03-19 13:36:52.701511604 +0100
--- src/version.c 2020-03-19 13:54:44.906256768 +0100
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 406,
/**/

--
### Hiroshima 45, Chernobyl 86, Windows 95 ###

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages