view src/testdir/test_autochdir.vim @ 16326:1679b9f54946 v8.1.1168

patch 8.1.1168: not all screen update code of terminal is executed in tests commit https://github.com/vim/vim/commit/87dcfd75c218107ca966c80a0a56b236be046fc9 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 13 22:35:29 2019 +0200 patch 8.1.1168: not all screen update code of terminal is executed in tests Problem: Not all screen update code of the terminal window is executed in tests. Solution: Redraw before taking a screenshot.
author Bram Moolenaar <Bram@vim.org>
date Sat, 13 Apr 2019 22:45:04 +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