Mercurial > vim
annotate src/testdir/test17.in @ 11984:829a855d3204
Added tag v8.0.0872 for changeset 448635f73e096506361ae48f09eb19894910cab6
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 05 Aug 2017 19:45:05 +0200 |
parents | 05e7d084c6c2 |
children |
rev | line source |
---|---|
3699 | 1 Tests for: |
2 - "gf" on ${VAR}, | |
3 - ":checkpath!" with various 'include' settings. | |
7 | 4 |
5 STARTTEST | |
6 :so small.vim | |
7 :if has("ebcdic") | |
8 : set isfname=@,240-249,/,.,-,_,+,,,$,:,~,{,} | |
9 :else | |
10 : set isfname=@,48-57,/,.,-,_,+,,,$,:,~,{,} | |
11 :endif | |
9254
05e7d084c6c2
commit https://github.com/vim/vim/commit/abc70bbf363dbbe3f2bf714102f55648a512791e
Christian Brabandt <cb@256bit.org>
parents:
7003
diff
changeset
|
12 :" |
7 | 13 :if has("unix") |
14 :let $CDIR = "." | |
15 /CDIR | |
16 :else | |
17 :if has("amiga") | |
18 :let $TDIR = "/testdir" | |
19 :else | |
20 :let $TDIR = "." | |
21 :endif | |
22 /TDIR | |
23 :endif | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
24 :" Dummy writing for making that sure gf doesn't fail even if the current |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
25 :" file is modified. It can be occurred when executing the following command |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
26 :" directly on Windows without fixing the 'fileformat': |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
27 :" > nmake -f Make_dos.mak test17.out |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
28 :w! test.out |
7 | 29 gf |
5118
5569d11ef585
updated for version 7.3.1302
Bram Moolenaar <bram@vim.org>
parents:
4956
diff
changeset
|
30 :set ff=unix |
7 | 31 :w! test.out |
3699 | 32 :brewind |
7 | 33 ENDTEST |
34 | |
35 ${CDIR}/test17a.in | |
36 $TDIR/test17a.in | |
3699 | 37 |
38 STARTTEST | |
39 :" check for 'include' without \zs or \ze | |
40 :lang C | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
41 :call delete("./Xbase.a") |
9254
05e7d084c6c2
commit https://github.com/vim/vim/commit/abc70bbf363dbbe3f2bf714102f55648a512791e
Christian Brabandt <cb@256bit.org>
parents:
7003
diff
changeset
|
42 :call delete("Xdir1", "rf") |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
43 :!mkdir Xdir1 |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
44 :!mkdir "Xdir1/dir2" |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
45 :e! Xdir1/dir2/foo.a |
7003 | 46 i#include "bar.a": |
3699 | 47 :w |
48 :e Xdir1/dir2/bar.a | |
7003 | 49 i#include "baz.a": |
3699 | 50 :w |
51 :e Xdir1/dir2/baz.a | |
7003 | 52 i#include "foo.a": |
3699 | 53 :w |
54 :e Xbase.a | |
55 :set path=Xdir1/dir2 | |
7003 | 56 i#include <foo.a>: |
3699 | 57 :w |
58 :redir! >>test.out | |
59 :checkpath! | |
60 :redir END | |
61 :brewind | |
62 ENDTEST | |
63 | |
64 STARTTEST | |
65 :" check for 'include' with \zs and \ze | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
66 :call delete("./Xbase.b") |
9254
05e7d084c6c2
commit https://github.com/vim/vim/commit/abc70bbf363dbbe3f2bf714102f55648a512791e
Christian Brabandt <cb@256bit.org>
parents:
7003
diff
changeset
|
67 :call delete("Xdir1", "rf") |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
68 :!mkdir Xdir1 |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
69 :!mkdir "Xdir1/dir2" |
3699 | 70 :let &include='^\s*%inc\s*/\zs[^/]\+\ze' |
71 :function! DotsToSlashes() | |
72 : return substitute(v:fname, '\.', '/', 'g') . '.b' | |
73 :endfunction | |
74 :let &includeexpr='DotsToSlashes()' | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
75 :e! Xdir1/dir2/foo.b |
7003 | 76 i%inc /bar/: |
3699 | 77 :w |
78 :e Xdir1/dir2/bar.b | |
7003 | 79 i%inc /baz/: |
3699 | 80 :w |
81 :e Xdir1/dir2/baz.b | |
7003 | 82 i%inc /foo/: |
3699 | 83 :w |
84 :e Xbase.b | |
85 :set path=Xdir1/dir2 | |
7003 | 86 i%inc /foo/: |
3699 | 87 :w |
88 :redir! >>test.out | |
89 :checkpath! | |
90 :redir END | |
91 :brewind | |
92 ENDTEST | |
93 | |
94 STARTTEST | |
95 :" check for 'include' with \zs and no \ze | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
96 :call delete("./Xbase.c") |
9254
05e7d084c6c2
commit https://github.com/vim/vim/commit/abc70bbf363dbbe3f2bf714102f55648a512791e
Christian Brabandt <cb@256bit.org>
parents:
7003
diff
changeset
|
97 :call delete("Xdir1", "rf") |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
98 :!mkdir Xdir1 |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
99 :!mkdir "Xdir1/dir2" |
3699 | 100 :let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze' |
101 :function! StripNewlineChar() | |
102 : if v:fname =~ '\n$' | |
103 : return v:fname[:-2] | |
104 : endif | |
105 : return v:fname | |
106 :endfunction | |
107 :let &includeexpr='StripNewlineChar()' | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
108 :e! Xdir1/dir2/foo.c |
7003 | 109 i%inc bar.c: |
3699 | 110 :w |
111 :e Xdir1/dir2/bar.c | |
7003 | 112 i%inc baz.c: |
3699 | 113 :w |
114 :e Xdir1/dir2/baz.c | |
7003 | 115 i%inc foo.c: |
3699 | 116 :w |
117 :e Xdir1/dir2/FALSE.c | |
7003 | 118 i%inc foo.c: |
3699 | 119 :w |
120 :e Xbase.c | |
121 :set path=Xdir1/dir2 | |
7003 | 122 i%inc FALSE.c foo.c: |
3699 | 123 :w |
124 :redir! >>test.out | |
125 :checkpath! | |
126 :redir END | |
127 :brewind | |
5118
5569d11ef585
updated for version 7.3.1302
Bram Moolenaar <bram@vim.org>
parents:
4956
diff
changeset
|
128 :" change "\" to "/" for Windows and fix 'fileformat' |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
129 :e test.out |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
130 :%s#\\#/#g |
5118
5569d11ef585
updated for version 7.3.1302
Bram Moolenaar <bram@vim.org>
parents:
4956
diff
changeset
|
131 :set ff& |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
132 :w |
3699 | 133 :q |
134 ENDTEST | |
135 |