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