Mercurial > vim
annotate src/testdir/test17.in @ 6821:cd7a7975f92c v7.4.732
patch 7.4.732
Problem: The cursor line is not always updated for the "O" command.
Solution: Reset the VALID_CROW flag. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 09 Jun 2015 19:23:46 +0200 |
parents | 5569d11ef585 |
children | bc269cf15ccd |
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 | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
12 :function! DeleteDirectory(dir) |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
13 : if has("win16") || has("win32") || has("win64") || has("dos16") || has("dos32") |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
14 : exec "silent !rmdir /Q /S " . a:dir |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
15 : else |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
16 : exec "silent !rm -rf " . a:dir |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
17 : endif |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
18 :endfun |
7 | 19 :if has("unix") |
20 :let $CDIR = "." | |
21 /CDIR | |
22 :else | |
23 :if has("amiga") | |
24 :let $TDIR = "/testdir" | |
25 :else | |
26 :let $TDIR = "." | |
27 :endif | |
28 /TDIR | |
29 :endif | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
30 :" 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
|
31 :" 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
|
32 :" directly on Windows without fixing the 'fileformat': |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
33 :" > nmake -f Make_dos.mak test17.out |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
34 :w! test.out |
7 | 35 gf |
5118
5569d11ef585
updated for version 7.3.1302
Bram Moolenaar <bram@vim.org>
parents:
4956
diff
changeset
|
36 :set ff=unix |
7 | 37 :w! test.out |
3699 | 38 :brewind |
7 | 39 ENDTEST |
40 | |
41 ${CDIR}/test17a.in | |
42 $TDIR/test17a.in | |
3699 | 43 |
44 STARTTEST | |
45 :" check for 'include' without \zs or \ze | |
46 :lang C | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
47 :call delete("./Xbase.a") |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
48 :call DeleteDirectory("Xdir1") |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
49 :!mkdir Xdir1 |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
50 :!mkdir "Xdir1/dir2" |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
51 :e! Xdir1/dir2/foo.a |
3699 | 52 i#include "bar.a" |
53 :w | |
54 :e Xdir1/dir2/bar.a | |
55 i#include "baz.a" | |
56 :w | |
57 :e Xdir1/dir2/baz.a | |
58 i#include "foo.a" | |
59 :w | |
60 :e Xbase.a | |
61 :set path=Xdir1/dir2 | |
62 i#include <foo.a> | |
63 :w | |
64 :redir! >>test.out | |
65 :checkpath! | |
66 :redir END | |
67 :brewind | |
68 ENDTEST | |
69 | |
70 STARTTEST | |
71 :" check for 'include' with \zs and \ze | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
72 :call delete("./Xbase.b") |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
73 :call DeleteDirectory("Xdir1") |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
74 :!mkdir Xdir1 |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
75 :!mkdir "Xdir1/dir2" |
3699 | 76 :let &include='^\s*%inc\s*/\zs[^/]\+\ze' |
77 :function! DotsToSlashes() | |
78 : return substitute(v:fname, '\.', '/', 'g') . '.b' | |
79 :endfunction | |
80 :let &includeexpr='DotsToSlashes()' | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
81 :e! Xdir1/dir2/foo.b |
3699 | 82 i%inc /bar/ |
83 :w | |
84 :e Xdir1/dir2/bar.b | |
85 i%inc /baz/ | |
86 :w | |
87 :e Xdir1/dir2/baz.b | |
88 i%inc /foo/ | |
89 :w | |
90 :e Xbase.b | |
91 :set path=Xdir1/dir2 | |
92 i%inc /foo/ | |
93 :w | |
94 :redir! >>test.out | |
95 :checkpath! | |
96 :redir END | |
97 :brewind | |
98 ENDTEST | |
99 | |
100 STARTTEST | |
101 :" 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
|
102 :call delete("./Xbase.c") |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
103 :call DeleteDirectory("Xdir1") |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
104 :!mkdir Xdir1 |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
105 :!mkdir "Xdir1/dir2" |
3699 | 106 :let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze' |
107 :function! StripNewlineChar() | |
108 : if v:fname =~ '\n$' | |
109 : return v:fname[:-2] | |
110 : endif | |
111 : return v:fname | |
112 :endfunction | |
113 :let &includeexpr='StripNewlineChar()' | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
114 :e! Xdir1/dir2/foo.c |
3699 | 115 i%inc bar.c |
116 :w | |
117 :e Xdir1/dir2/bar.c | |
118 i%inc baz.c | |
119 :w | |
120 :e Xdir1/dir2/baz.c | |
121 i%inc foo.c | |
122 :w | |
123 :e Xdir1/dir2/FALSE.c | |
124 i%inc foo.c | |
125 :w | |
126 :e Xbase.c | |
127 :set path=Xdir1/dir2 | |
128 i%inc FALSE.c foo.c | |
129 :w | |
130 :redir! >>test.out | |
131 :checkpath! | |
132 :redir END | |
133 :brewind | |
5118
5569d11ef585
updated for version 7.3.1302
Bram Moolenaar <bram@vim.org>
parents:
4956
diff
changeset
|
134 :" change "\" to "/" for Windows and fix 'fileformat' |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
135 :e test.out |
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
136 :%s#\\#/#g |
5118
5569d11ef585
updated for version 7.3.1302
Bram Moolenaar <bram@vim.org>
parents:
4956
diff
changeset
|
137 :set ff& |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
3699
diff
changeset
|
138 :w |
3699 | 139 :q |
140 ENDTEST | |
141 |