annotate src/testdir/test17.in @ 3699:d29aa05b7e31 v7.3.609

updated for version 7.3.609 Problem: File names in :checkpath! output are garbled. Solution: Check for \zs in the pattern. (Lech Lorens)
author Bram Moolenaar <bram@vim.org>
date Wed, 25 Jul 2012 13:46:30 +0200
parents 3fc0f57ecb91
children 5cd32322154c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
1 Tests for:
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
2 - "gf" on ${VAR},
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
3 - ":checkpath!" with various 'include' settings.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 STARTTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 :so small.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 :if has("ebcdic")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 : set isfname=@,240-249,/,.,-,_,+,,,$,:,~,{,}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 :else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 : set isfname=@,48-57,/,.,-,_,+,,,$,:,~,{,}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 :if has("unix")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 :let $CDIR = "."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 /CDIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 :else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 :if has("amiga")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 :let $TDIR = "/testdir"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 :else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 :let $TDIR = "."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 /TDIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 gf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 :w! test.out
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
25 :brewind
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 ENDTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 ${CDIR}/test17a.in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 $TDIR/test17a.in
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
30
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
31 STARTTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
32 :" check for 'include' without \zs or \ze
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
33 :lang C
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
34 :!rm -f ./Xbase.a
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
35 :!rm -rf ./Xdir1
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
36 :!mkdir -p Xdir1/dir2
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
37 :e Xdir1/dir2/foo.a
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
38 i#include "bar.a"
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
39 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
40 :e Xdir1/dir2/bar.a
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
41 i#include "baz.a"
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
42 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
43 :e Xdir1/dir2/baz.a
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
44 i#include "foo.a"
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
45 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
46 :e Xbase.a
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
47 :set path=Xdir1/dir2
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
48 i#include <foo.a>
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
49 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
50 :redir! >>test.out
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
51 :checkpath!
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
52 :redir END
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
53 :brewind
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
54 ENDTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
55
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
56 STARTTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
57 :" check for 'include' with \zs and \ze
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
58 :!rm -f ./Xbase.b
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
59 :!rm -rf ./Xdir1
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
60 :!mkdir -p Xdir1/dir2
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
61 :let &include='^\s*%inc\s*/\zs[^/]\+\ze'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
62 :function! DotsToSlashes()
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
63 : return substitute(v:fname, '\.', '/', 'g') . '.b'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
64 :endfunction
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
65 :let &includeexpr='DotsToSlashes()'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
66 :e Xdir1/dir2/foo.b
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
67 i%inc /bar/
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
68 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
69 :e Xdir1/dir2/bar.b
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
70 i%inc /baz/
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
71 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
72 :e Xdir1/dir2/baz.b
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
73 i%inc /foo/
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
74 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
75 :e Xbase.b
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
76 :set path=Xdir1/dir2
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
77 i%inc /foo/
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
78 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
79 :redir! >>test.out
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
80 :checkpath!
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
81 :redir END
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
82 :brewind
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
83 ENDTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
84
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
85 STARTTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
86 :" check for 'include' with \zs and no \ze
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
87 :!rm -f ./Xbase.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
88 :!rm -rf ./Xdir1
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
89 :!mkdir -p Xdir1/dir2
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
90 :let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
91 :function! StripNewlineChar()
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
92 : if v:fname =~ '\n$'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
93 : return v:fname[:-2]
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
94 : endif
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
95 : return v:fname
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
96 :endfunction
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
97 :let &includeexpr='StripNewlineChar()'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
98 :e Xdir1/dir2/foo.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
99 i%inc bar.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
100 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
101 :e Xdir1/dir2/bar.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
102 i%inc baz.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
103 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
104 :e Xdir1/dir2/baz.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
105 i%inc foo.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
106 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
107 :e Xdir1/dir2/FALSE.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
108 i%inc foo.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
109 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
110 :e Xbase.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
111 :set path=Xdir1/dir2
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
112 i%inc FALSE.c foo.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
113 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
114 :redir! >>test.out
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
115 :checkpath!
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
116 :redir END
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
117 :brewind
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
118 :q
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
119 ENDTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
120