view src/testdir/test_autochdir.vim @ 14487:336213a840d9 v8.1.0257

patch 8.1.0257: no test for pathshorten() commit https://github.com/vim/vim/commit/bfde0b482d25db43e9fc5a35c771b859b1eb8828 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 8 22:27:31 2018 +0200 patch 8.1.0257: no test for pathshorten() Problem: No test for pathshorten(). Solution: Add a test. (Dominique Pelle, closes https://github.com/vim/vim/issues/3295)
author Christian Brabandt <cb@256bit.org>
date Wed, 08 Aug 2018 22:30:05 +0200
parents 03a6aeea2096
children 90ab2d3ce11d
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
  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