comparison src/testdir/test_autocmd.vim @ 19699:4e9c794c3af1 v8.2.0406

patch 8.2.0406: FileReadCmd event not well tested Commit: https://github.com/vim/vim/commit/e32848780cc07c368ba2e088cdefdbb8c3b827c2 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 19 13:55:03 2020 +0100 patch 8.2.0406: FileReadCmd event not well tested Problem: FileReadCmd event not well tested. Solution: Add a test.
author Bram Moolenaar <Bram@vim.org>
date Thu, 19 Mar 2020 14:00:05 +0100
parents 60b5abfc4897
children 0927df746554
comparison
equal deleted inserted replaced
19698:2e58d0a0526c 19699:4e9c794c3af1
2406 au! TermChanged 2406 au! TermChanged
2407 let &term = term_save 2407 let &term = term_save
2408 bwipe! 2408 bwipe!
2409 endfunc 2409 endfunc
2410 2410
2411 " Test for FileReadCmd autocmd
2412 func Test_autocmd_FileReadCmd()
2413 func ReadFileCmd()
2414 call append(line('$'), "v:cmdarg = " .. v:cmdarg)
2415 endfunc
2416 augroup FileReadCmdTest
2417 au!
2418 au FileReadCmd Xtest call ReadFileCmd()
2419 augroup END
2420
2421 new
2422 read ++bin Xtest
2423 read ++nobin Xtest
2424 read ++edit Xtest
2425 read ++bad=keep Xtest
2426 read ++bad=drop Xtest
2427 read ++bad=- Xtest
2428 read ++ff=unix Xtest
2429 read ++ff=dos Xtest
2430 read ++ff=mac Xtest
2431 read ++enc=utf-8 Xtest
2432
2433 call assert_equal(['',
2434 \ 'v:cmdarg = ++bin',
2435 \ 'v:cmdarg = ++nobin',
2436 \ 'v:cmdarg = ++edit',
2437 \ 'v:cmdarg = ++bad=keep',
2438 \ 'v:cmdarg = ++bad=drop',
2439 \ 'v:cmdarg = ++bad=-',
2440 \ 'v:cmdarg = ++ff=unix',
2441 \ 'v:cmdarg = ++ff=dos',
2442 \ 'v:cmdarg = ++ff=mac',
2443 \ 'v:cmdarg = ++enc=utf-8'], getline(1, '$'))
2444
2445 close!
2446 augroup FileReadCmdTest
2447 au!
2448 augroup END
2449 delfunc ReadFileCmd
2450 endfunc
2451
2411 " vim: shiftwidth=2 sts=2 expandtab 2452 " vim: shiftwidth=2 sts=2 expandtab