summaryrefslogtreecommitdiff
path: root/src/testdir/test17.in
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-07-25 13:46:30 +0200
committerBram Moolenaar <Bram@vim.org>2012-07-25 13:46:30 +0200
commit058bdcfd5d7f2fd0945e3cb9c84cab514cd95fb9 (patch)
treec09d1ad28734ca463710860980bb9f92638bdae2 /src/testdir/test17.in
parent6763c140d656703814d9a268c8492762aee69469 (diff)
downloadvim-058bdcfd5d7f2fd0945e3cb9c84cab514cd95fb9.zip
updated for version 7.3.609
Problem: File names in :checkpath! output are garbled. Solution: Check for \zs in the pattern. (Lech Lorens)
Diffstat (limited to 'src/testdir/test17.in')
-rw-r--r--src/testdir/test17.in97
1 files changed, 95 insertions, 2 deletions
diff --git a/src/testdir/test17.in b/src/testdir/test17.in
index e59144ffb..9c25e9991 100644
--- a/src/testdir/test17.in
+++ b/src/testdir/test17.in
@@ -1,4 +1,6 @@
-Tests for "gf" on ${VAR}
+Tests for:
+- "gf" on ${VAR},
+- ":checkpath!" with various 'include' settings.
STARTTEST
:so small.vim
@@ -20,8 +22,99 @@ STARTTEST
:endif
gf
:w! test.out
-:qa!
+:brewind
ENDTEST
${CDIR}/test17a.in
$TDIR/test17a.in
+
+STARTTEST
+:" check for 'include' without \zs or \ze
+:lang C
+:!rm -f ./Xbase.a
+:!rm -rf ./Xdir1
+:!mkdir -p Xdir1/dir2
+:e Xdir1/dir2/foo.a
+i#include "bar.a"
+:w
+:e Xdir1/dir2/bar.a
+i#include "baz.a"
+:w
+:e Xdir1/dir2/baz.a
+i#include "foo.a"
+:w
+:e Xbase.a
+:set path=Xdir1/dir2
+i#include <foo.a>
+:w
+:redir! >>test.out
+:checkpath!
+:redir END
+:brewind
+ENDTEST
+
+STARTTEST
+:" check for 'include' with \zs and \ze
+:!rm -f ./Xbase.b
+:!rm -rf ./Xdir1
+:!mkdir -p Xdir1/dir2
+:let &include='^\s*%inc\s*/\zs[^/]\+\ze'
+:function! DotsToSlashes()
+: return substitute(v:fname, '\.', '/', 'g') . '.b'
+:endfunction
+:let &includeexpr='DotsToSlashes()'
+:e Xdir1/dir2/foo.b
+i%inc /bar/
+:w
+:e Xdir1/dir2/bar.b
+i%inc /baz/
+:w
+:e Xdir1/dir2/baz.b
+i%inc /foo/
+:w
+:e Xbase.b
+:set path=Xdir1/dir2
+i%inc /foo/
+:w
+:redir! >>test.out
+:checkpath!
+:redir END
+:brewind
+ENDTEST
+
+STARTTEST
+:" check for 'include' with \zs and no \ze
+:!rm -f ./Xbase.c
+:!rm -rf ./Xdir1
+:!mkdir -p Xdir1/dir2
+:let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze'
+:function! StripNewlineChar()
+: if v:fname =~ '\n$'
+: return v:fname[:-2]
+: endif
+: return v:fname
+:endfunction
+:let &includeexpr='StripNewlineChar()'
+:e Xdir1/dir2/foo.c
+i%inc bar.c
+:w
+:e Xdir1/dir2/bar.c
+i%inc baz.c
+:w
+:e Xdir1/dir2/baz.c
+i%inc foo.c
+:w
+:e Xdir1/dir2/FALSE.c
+i%inc foo.c
+:w
+:e Xbase.c
+:set path=Xdir1/dir2
+i%inc FALSE.c foo.c
+:w
+:redir! >>test.out
+:checkpath!
+:redir END
+:brewind
+:q
+ENDTEST
+