view src/testdir/test_findfile.vim @ 15599:9da8ae285a02 v8.1.0807

patch 8.1.0807: session test fails on MS-Windows commit https://github.com/vim/vim/commit/9e79ccbe9ce6fce18939c7ac2e5ad059a3bd1951 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 24 15:57:30 2019 +0100 patch 8.1.0807: session test fails on MS-Windows Problem: Session test fails on MS-Windows. Solution: Don't try creating file with illegal name.
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Jan 2019 16:00:08 +0100
parents a479b7064550
children 977a05589b65
line wrap: on
line source

" Test for findfile()
"
func Test_findfile()
  new
  let cwd=getcwd()
  cd ..

  " Tests may be run from a shadow directory, so an extra cd needs to be done to
  " get above src/
  if fnamemodify(getcwd(), ':t') != 'src'
    cd ../.. 
  else 
    cd .. 
  endif
  set ssl

  call assert_equal('src/testdir/test_findfile.vim', findfile('test_findfile.vim','src/test*'))
  exe "cd" cwd
  cd ..
  call assert_equal('testdir/test_findfile.vim', findfile('test_findfile.vim','test*'))
  call assert_equal('testdir/test_findfile.vim', findfile('test_findfile.vim','testdir'))

  exe "cd" cwd
  q!
endfunc