To: vim_dev@googlegroups.com Subject: Patch 8.2.0406 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@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 ///