summaryrefslogtreecommitdiff
path: root/src/testdir/test_autochdir.vim
blob: 05d69631c4e1a91774c2e194fbf3cdeb3a54c778 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
" Test 'autochdir' behavior

if !exists("+autochdir")
  finish
endif

func Test_set_filename()
  let cwd = getcwd()
  call test_autochdir()
  set acd
  new
  w samples/Xtest
  call assert_equal("Xtest", expand('%'))
  call assert_equal("samples", substitute(getcwd(), '.*/\(\k*\)', '\1', ''))
  bwipe!
  set noacd
  exe 'cd ' . cwd
  call delete('samples/Xtest')
endfunc