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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202003191255.02JCtaaS007246%40masaka.moolenaar.net.

Raspunde prin e-mail lui