view src/testdir/test_autochdir.vim @ 22744:f63d14eca5c4 v8.2.1920

patch 8.2.1920: listlbr test fails when run after another test Commit: https://github.com/vim/vim/commit/cf4d454df0619ee41ef40e7e91fce3fb061d7d5b Author: Bram Moolenaar <Bram@vim.org> Date: Wed Oct 28 22:46:42 2020 +0100 patch 8.2.1920: listlbr test fails when run after another test Problem: Listlbr test fails when run after another test. Solution: Add test separately to list of test targets.
author Bram Moolenaar <Bram@vim.org>
date Wed, 28 Oct 2020 23:00:04 +0100
parents 08940efa6b4e
children fa8161b003f6
line wrap: on
line source

" Test 'autochdir' behavior

source check.vim
CheckOption autochdir

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
  call chdir(cwd)
  call delete('samples/Xtest')
endfunc

" vim: shiftwidth=2 sts=2 expandtab