view src/testdir/test_autochdir.vim @ 16433:9c206a78ec04 v8.1.1221

patch 8.1.1221: filtering does not work when listing marks commit https://github.com/vim/vim/commit/ad6dc49a7564a99fca36c1928e3865787d3bd5b2 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 27 22:40:08 2019 +0200 patch 8.1.1221: filtering does not work when listing marks Problem: Filtering does not work when listing marks. Solution: Implement filtering marks. (Marcin Szamotulski, closes https://github.com/vim/vim/issues/3895)
author Bram Moolenaar <Bram@vim.org>
date Sat, 27 Apr 2019 22:45:05 +0200
parents 90ab2d3ce11d
children ebdf6cd89910
line wrap: on
line source

" Test 'autochdir' behavior

if !exists("+autochdir")
  finish
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