view src/testdir/test_autochdir.vim @ 20355:fc2d76e0994c v8.2.0733

patch 8.2.0733: Vim9: assigning to dict or list argument does not work Commit: https://github.com/vim/vim/commit/cb2bdb1c6d8b6df4a3d9cfb1ad9e602dace5d310 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 10 22:53:56 2020 +0200 patch 8.2.0733: Vim9: assigning to dict or list argument does not work Problem: Vim9: assigning to dict or list argument does not work. Solution: Recognize an argument as assignment target.
author Bram Moolenaar <Bram@vim.org>
date Sun, 10 May 2020 23:00:04 +0200
parents 26a04a556982
children 08940efa6b4e
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