1" Test 'autochdir' behavior
2
3if !exists("+autochdir")
4  finish
5endif
6
7func Test_set_filename()
8  call test_autochdir()
9  set acd
10  new
11  w samples/Xtest
12  call assert_equal("Xtest", expand('%'))
13  call assert_equal("samples", substitute(getcwd(), '.*/\(\k*\)', '\1', ''))
14  bwipe!
15  set noacd
16  call delete('samples/Xtest')
17endfunc
18