aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_gf.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-17 11:30:32 +0800
committerGitHub <noreply@github.com>2022-07-17 11:30:32 +0800
commit53c398d8f44f1796c216402c953512eb57733529 (patch)
treea4abcbed4256058b40e4dc1badd2f06c22079abf /src/nvim/testdir/test_gf.vim
parent9f837a5dcf61e0b27778dd7127036e12d694d92c (diff)
parent7c3a87182d471649126c58d999d46abede6f60cd (diff)
downloadrneovim-53c398d8f44f1796c216402c953512eb57733529.tar.gz
rneovim-53c398d8f44f1796c216402c953512eb57733529.tar.bz2
rneovim-53c398d8f44f1796c216402c953512eb57733529.zip
Merge pull request #19402 from zeertzjq/vim-8.2.0655
vim-patch:8.2.{0655,1040}: not enough tests
Diffstat (limited to 'src/nvim/testdir/test_gf.vim')
-rw-r--r--src/nvim/testdir/test_gf.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_gf.vim b/src/nvim/testdir/test_gf.vim
index 51e1a06390..1569177d66 100644
--- a/src/nvim/testdir/test_gf.vim
+++ b/src/nvim/testdir/test_gf.vim
@@ -35,6 +35,13 @@ func Test_gf_url()
call search("URL")
call assert_equal("URL://machine.name:1234?q=vim", expand("<cfile>"))
+ %d
+ call setline(1, "demo://remote_file")
+ wincmd f
+ call assert_equal('demo://remote_file', @%)
+ call assert_equal(2, winnr('$'))
+ close!
+
set isf&vim
enew!
endfunc
@@ -170,4 +177,21 @@ func Test_gf_error()
bwipe!
endfunc
+" If a file is not found by 'gf', then 'includeexpr' should be used to locate
+" the file.
+func Test_gf_includeexpr()
+ new
+ let g:Inc_fname = ''
+ func IncFunc()
+ let g:Inc_fname = v:fname
+ return v:fname
+ endfunc
+ setlocal includeexpr=IncFunc()
+ call setline(1, 'somefile.java')
+ call assert_fails('normal gf', 'E447:')
+ call assert_equal('somefile.java', g:Inc_fname)
+ close!
+ delfunc IncFunc
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab