From 210d803777a82616710fd0816fc743ed987f2347 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 6 May 2019 21:10:48 -0400 Subject: vim-patch:8.1.1285: test17 is old style Problem: Test17 is old style. Solution: Turn into new style test. (Yegappan Lakshmanan, closes vim/vim#4347) https://github.com/vim/vim/commit/f0ab01f6d868164ed0bb247b6f7b152e6929ef18 --- src/nvim/testdir/test_gf.vim | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/nvim/testdir/test_gf.vim') diff --git a/src/nvim/testdir/test_gf.vim b/src/nvim/testdir/test_gf.vim index d233046d2b..accd21e9a3 100644 --- a/src/nvim/testdir/test_gf.vim +++ b/src/nvim/testdir/test_gf.vim @@ -64,3 +64,38 @@ func Test_gF() bwipe Xfile bwipe Xfile2 endfunc + +" Test for invoking 'gf' on a ${VAR} variable +func Test_gf() + if has("ebcdic") + set isfname=@,240-249,/,.,-,_,+,,,$,:,~,{,} + else + set isfname=@,48-57,/,.,-,_,+,,,$,:,~,{,} + endif + + call writefile(["Test for gf command"], "Xtest1") + if has("unix") + call writefile([" ${CDIR}/Xtest1"], "Xtestgf") + else + call writefile([" $TDIR/Xtest1"], "Xtestgf") + endif + new Xtestgf + if has("unix") + let $CDIR = "." + /CDIR + else + if has("amiga") + let $TDIR = "/testdir" + else + let $TDIR = "." + endif + /TDIR + endif + + normal gf + call assert_equal('Xtest1', fnamemodify(bufname(''), ":t")) + close! + + call delete('Xtest1') + call delete('Xtestgf') +endfunc -- cgit