1
0
forked from aniani/vim
Files
vim/src/testdir/test_autochdir.vim
Bram Moolenaar 9c0cec65f8 patch 8.1.1476: no statistics displayed after running tests
Problem:    No statistics displayed after running tests.
Solution:   Summarize the test results. (Christian Brabandt, closes #4391)
            Also make it possible to report a skipped file.
2019-06-06 13:38:15 +02:00

28 lines
602 B
VimL

" Test 'autochdir' behavior
if !exists("+autochdir")
throw 'Skipped: autochdir feature missing'
endif
func Test_set_filename()
let cwd = getcwd()
call test_autochdir()
set acd
let s:li = []
autocmd DirChanged auto call add(s:li, "autocd")
autocmd DirChanged auto call add(s:li, expand("<afile>"))
new
w samples/Xtest
call assert_equal("Xtest", expand('%'))
call assert_equal("samples", substitute(getcwd(), '.*/\(\k*\)', '\1', ''))
call assert_equal(["autocd", getcwd()], s:li)
bwipe!
au! DirChanged
set noacd
exe 'cd ' . cwd
call delete('samples/Xtest')
endfunc