annotate src/testdir/test17.in @ 8074:dc32c8026899 v7.4.1331

commit https://github.com/vim/vim/commit/d46ae142aa9452e99576b5e923de974704e3c896 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 16 13:33:52 2016 +0100 patch 7.4.1331 Problem: Crash when closing the channel in a callback. (Christian J. Robinson) Solution: Take the callback out of the list before invoking it.
author Christian Brabandt <cb@256bit.org>
date Tue, 16 Feb 2016 13:45:04 +0100
parents bc269cf15ccd
children 05e7d084c6c2
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
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 :if has("unix")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 :let $CDIR = "."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 /CDIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 :else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 :if has("amiga")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 :let $TDIR = "/testdir"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 :else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 :let $TDIR = "."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 /TDIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 gf
5118
5569d11ef585 updated for version 7.3.1302
Bram Moolenaar <bram@vim.org>
parents: 4956
diff changeset
36 :set ff=unix
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 :w! test.out
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
38 :brewind
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 ENDTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 ${CDIR}/test17a.in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 $TDIR/test17a.in
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
43
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
44 STARTTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
45 :" check for 'include' without \zs or \ze
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
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
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
52 i#include "bar.a":
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
53 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
54 :e Xdir1/dir2/bar.a
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
55 i#include "baz.a":
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
56 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
57 :e Xdir1/dir2/baz.a
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
58 i#include "foo.a":
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
59 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
60 :e Xbase.a
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
61 :set path=Xdir1/dir2
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
62 i#include <foo.a>:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
63 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
64 :redir! >>test.out
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
65 :checkpath!
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
66 :redir END
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
67 :brewind
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
68 ENDTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
69
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
70 STARTTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
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
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
76 :let &include='^\s*%inc\s*/\zs[^/]\+\ze'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
77 :function! DotsToSlashes()
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
78 : return substitute(v:fname, '\.', '/', 'g') . '.b'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
79 :endfunction
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
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
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
82 i%inc /bar/:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
83 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
84 :e Xdir1/dir2/bar.b
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
85 i%inc /baz/:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
86 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
87 :e Xdir1/dir2/baz.b
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
88 i%inc /foo/:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
89 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
90 :e Xbase.b
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
91 :set path=Xdir1/dir2
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
92 i%inc /foo/:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
93 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
94 :redir! >>test.out
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
95 :checkpath!
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
96 :redir END
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
97 :brewind
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
98 ENDTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
99
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
100 STARTTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
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
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
106 :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
107 :function! StripNewlineChar()
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
108 : if v:fname =~ '\n$'
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
109 : return v:fname[:-2]
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
110 : endif
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
111 : return v:fname
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
112 :endfunction
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
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
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
115 i%inc bar.c:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
116 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
117 :e Xdir1/dir2/bar.c
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
118 i%inc baz.c:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
119 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
120 :e Xdir1/dir2/baz.c
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
121 i%inc foo.c:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
122 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
123 :e Xdir1/dir2/FALSE.c
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
124 i%inc foo.c:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
125 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
126 :e Xbase.c
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
127 :set path=Xdir1/dir2
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5118
diff changeset
128 i%inc FALSE.c foo.c:
3699
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
129 :w
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
130 :redir! >>test.out
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
131 :checkpath!
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
132 :redir END
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
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
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
139 :q
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
140 ENDTEST
d29aa05b7e31 updated for version 7.3.609
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
141