summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1285
blob: d9db2fd5d03d02ef57d9bab3dc2438354ab2d578 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1285
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.1285
Problem:    Test17 is old style.
Solution:   Turn into new style test. (Yegappan Lakshmanan, closes #4347)
Files:	    src/Makefile, src/testdir/Make_all.mak, src/testdir/Make_vms.mms,
            src/testdir/test17.in, src/testdir/test17.ok,
            src/testdir/test17a.in, src/testdir/test_checkpath.vim,
            src/testdir/test_gf.vim


*** ../vim-8.1.1284/src/Makefile	2019-05-01 18:08:38.267237229 +0200
--- src/Makefile	2019-05-06 21:56:13.787318060 +0200
***************
*** 2175,2181 ****
  # These do not depend on the executable, compile it when needed.
  test1 \
  	test_eval \
! 	test3 test17 \
  	test29 test30 test37 test39 \
  	test42 test44 test48 test49 \
  	test52 test59 \
--- 2176,2182 ----
  # These do not depend on the executable, compile it when needed.
  test1 \
  	test_eval \
! 	test3 \
  	test29 test30 test37 test39 \
  	test42 test44 test48 test49 \
  	test52 test59 \
*** ../vim-8.1.1284/src/testdir/Make_all.mak	2019-05-04 21:08:17.119814244 +0200
--- src/testdir/Make_all.mak	2019-05-06 21:56:13.787318060 +0200
***************
*** 44,50 ****
  
  # Tests that run on most systems, but not on VMS
  SCRIPTS_MORE4 = \
- 	test17.out \
  	test30.out \
  	test59.out \
  	test72.out \
--- 44,49 ----
***************
*** 82,87 ****
--- 81,87 ----
  	test_channel \
  	test_charsearch \
  	test_charsearch_utf8 \
+ 	test_checkpath \
  	test_cindent \
  	test_clientserver \
  	test_close_count \
***************
*** 302,307 ****
--- 302,308 ----
  	test_changelist.res \
  	test_channel.res \
  	test_charsearch.res \
+ 	test_checkpath.res \
  	test_cindent.res \
  	test_clientserver.res \
  	test_close_count.res \
*** ../vim-8.1.1284/src/testdir/Make_vms.mms	2019-04-27 18:00:29.851064563 +0200
--- src/testdir/Make_vms.mms	2019-05-06 21:56:13.787318060 +0200
***************
*** 83,89 ****
         test_eval.out
  
  # Known problems:
- # test17: ?
  #
  # test30: bug, most probably - a problem around mac format
  #
--- 83,88 ----
***************
*** 102,108 ****
  .ENDIF
  
  .IFDEF WANT_UNIX
! SCRIPT_UNIX = test10.out test17.out test27.out test49.out
  .ENDIF
  
  .IFDEF WANT_WIN
--- 101,107 ----
  .ENDIF
  
  .IFDEF WANT_UNIX
! SCRIPT_UNIX = test10.out test27.out test49.out
  .ENDIF
  
  .IFDEF WANT_WIN
*** ../vim-8.1.1284/src/testdir/test17.in	2016-06-08 21:39:44.000000000 +0200
--- src/testdir/test17.in	1970-01-01 01:00:00.000000000 +0100
***************
*** 1,135 ****
- Tests for:
- - "gf" on ${VAR},
- - ":checkpath!" with various 'include' settings.
- 
- STARTTEST
- :so small.vim
- :if has("ebcdic")
- : set isfname=@,240-249,/,.,-,_,+,,,$,:,~,{,}
- :else
- : set isfname=@,48-57,/,.,-,_,+,,,$,:,~,{,}
- :endif
- :"
- :if has("unix")
- :let $CDIR = "."
- /CDIR
- :else
- :if has("amiga")
- :let $TDIR = "/testdir"
- :else
- :let $TDIR = "."
- :endif
- /TDIR
- :endif
- :" Dummy writing for making that sure gf doesn't fail even if the current
- :" file is modified. It can be occurred when executing the following command
- :" directly on Windows without fixing the 'fileformat':
- :"  > nmake -f Make_dos.mak test17.out
- :w! test.out
- gf
- :set ff=unix
- :w! test.out
- :brewind
- ENDTEST
- 
- 	${CDIR}/test17a.in
- 	$TDIR/test17a.in
- 
- STARTTEST
- :" check for 'include' without \zs or \ze
- :lang C
- :call delete("./Xbase.a")
- :call delete("Xdir1", "rf")
- :!mkdir Xdir1
- :!mkdir "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
- :call delete("./Xbase.b")
- :call delete("Xdir1", "rf")
- :!mkdir Xdir1
- :!mkdir "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
- :call delete("./Xbase.c")
- :call delete("Xdir1", "rf")
- :!mkdir Xdir1
- :!mkdir "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
- :" change "\" to "/" for Windows and fix 'fileformat'
- :e test.out
- :%s#\\#/#g
- :set ff&
- :w
- :q
- ENDTEST
- 
--- 0 ----
*** ../vim-8.1.1284/src/testdir/test17.ok	2013-07-03 22:19:18.000000000 +0200
--- src/testdir/test17.ok	1970-01-01 01:00:00.000000000 +0100
***************
*** 1,33 ****
- This file is just to test "gf" in test 17.
- The contents is not important.
- Just testing!
- 
- 
- --- Included files in path ---
- Xdir1/dir2/foo.a
- Xdir1/dir2/foo.a -->
-   Xdir1/dir2/bar.a
-   Xdir1/dir2/bar.a -->
-     Xdir1/dir2/baz.a
-     Xdir1/dir2/baz.a -->
-       "foo.a"  (Already listed)
- 
- 
- --- Included files in path ---
- Xdir1/dir2/foo.b
- Xdir1/dir2/foo.b -->
-   Xdir1/dir2/bar.b
-   Xdir1/dir2/bar.b -->
-     Xdir1/dir2/baz.b
-     Xdir1/dir2/baz.b -->
-       foo  (Already listed)
- 
- 
- --- Included files in path ---
- Xdir1/dir2/foo.c
- Xdir1/dir2/foo.c -->
-   Xdir1/dir2/bar.c
-   Xdir1/dir2/bar.c -->
-     Xdir1/dir2/baz.c
-     Xdir1/dir2/baz.c -->
-       foo.c  (Already listed)
--- 0 ----
*** ../vim-8.1.1284/src/testdir/test17a.in	2010-08-04 16:06:51.000000000 +0200
--- src/testdir/test17a.in	1970-01-01 01:00:00.000000000 +0100
***************
*** 1,3 ****
- This file is just to test "gf" in test 17.
- The contents is not important.
- Just testing!
--- 0 ----
*** ../vim-8.1.1284/src/testdir/test_checkpath.vim	2019-05-06 21:59:14.610357666 +0200
--- src/testdir/test_checkpath.vim	2019-05-06 21:56:13.787318060 +0200
***************
*** 0 ****
--- 1,104 ----
+ " Tests for the :checkpath command
+ 
+ " Test for 'include' without \zs or \ze
+ func Test_checkpath1()
+   call mkdir("Xdir1/dir2", "p")
+   call writefile(['#include    "bar.a"'], 'Xdir1/dir2/foo.a')
+   call writefile(['#include    "baz.a"'], 'Xdir1/dir2/bar.a')
+   call writefile(['#include    "foo.a"'], 'Xdir1/dir2/baz.a')
+   call writefile(['#include    <foo.a>'], 'Xbase.a')
+ 
+   edit Xbase.a
+   set path=Xdir1/dir2
+   let res = split(execute("checkpath!"), "\n")
+   call assert_equal([
+ 	      \ '--- Included files in path ---',
+ 	      \ 'Xdir1/dir2/foo.a',
+ 	      \ 'Xdir1/dir2/foo.a -->',
+ 	      \ '  Xdir1/dir2/bar.a',
+ 	      \ '  Xdir1/dir2/bar.a -->',
+ 	      \ '    Xdir1/dir2/baz.a',
+ 	      \ '    Xdir1/dir2/baz.a -->',
+ 	      \ '      "foo.a"  (Already listed)'], res)
+ 
+   enew
+   call delete("./Xbase.a")
+   call delete("Xdir1", "rf")
+   set path&
+ endfunc
+ 
+ func DotsToSlashes()
+   return substitute(v:fname, '\.', '/', 'g') . '.b'
+ endfunc
+ 
+ " Test for 'include' with \zs and \ze
+ func Test_checkpath2()
+   call mkdir("Xdir1/dir2", "p")
+   call writefile(['%inc    /bar/'], 'Xdir1/dir2/foo.b')
+   call writefile(['%inc    /baz/'], 'Xdir1/dir2/bar.b')
+   call writefile(['%inc    /foo/'], 'Xdir1/dir2/baz.b')
+   call writefile(['%inc    /foo/'], 'Xbase.b')
+ 
+   let &include='^\s*%inc\s*/\zs[^/]\+\ze'
+   let &includeexpr='DotsToSlashes()'
+ 
+   edit Xbase.b
+   set path=Xdir1/dir2
+   let res = split(execute("checkpath!"), "\n")
+   call assert_equal([
+ 	      \ '--- Included files in path ---',
+ 	      \ 'Xdir1/dir2/foo.b',
+ 	      \ 'Xdir1/dir2/foo.b -->',
+ 	      \ '  Xdir1/dir2/bar.b',
+ 	      \ '  Xdir1/dir2/bar.b -->',
+ 	      \ '    Xdir1/dir2/baz.b',
+ 	      \ '    Xdir1/dir2/baz.b -->',
+ 	      \ '      foo  (Already listed)'], res)
+ 
+   enew
+   call delete("./Xbase.b")
+   call delete("Xdir1", "rf")
+   set path&
+   set include&
+   set includeexpr&
+ endfunc
+ 
+ func StripNewlineChar()
+   if v:fname =~ '\n$'
+     return v:fname[:-2]
+   endif
+   return v:fname
+ endfunc
+ 
+ " Test for 'include' with \zs and no \ze
+ func Test_checkpath3()
+   call mkdir("Xdir1/dir2", "p")
+   call writefile(['%inc    bar.c'], 'Xdir1/dir2/foo.c')
+   call writefile(['%inc    baz.c'], 'Xdir1/dir2/bar.c')
+   call writefile(['%inc    foo.c'], 'Xdir1/dir2/baz.c')
+   call writefile(['%inc    foo.c'], 'Xdir1/dir2/FALSE.c')
+   call writefile(['%inc    FALSE.c foo.c'], 'Xbase.c')
+ 
+   let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze'
+   let &includeexpr='StripNewlineChar()'
+ 
+   edit Xbase.c
+   set path=Xdir1/dir2
+   let res = split(execute("checkpath!"), "\n")
+   call assert_equal([
+ 	      \ '--- Included files in path ---',
+ 	      \ 'Xdir1/dir2/foo.c',
+ 	      \ 'Xdir1/dir2/foo.c -->',
+ 	      \ '  Xdir1/dir2/bar.c',
+ 	      \ '  Xdir1/dir2/bar.c -->',
+ 	      \ '    Xdir1/dir2/baz.c',
+ 	      \ '    Xdir1/dir2/baz.c -->',
+ 	      \ '      foo.c  (Already listed)'], res)
+ 
+   enew
+   call delete("./Xbase.c")
+   call delete("Xdir1", "rf")
+   set path&
+   set include&
+   set includeexpr&
+ endfunc
*** ../vim-8.1.1284/src/testdir/test_gf.vim	2019-03-09 12:32:50.673562149 +0100
--- src/testdir/test_gf.vim	2019-05-06 21:56:13.787318060 +0200
***************
*** 64,66 ****
--- 64,101 ----
    bwipe Xfile
    bwipe Xfile2
  endfunc
+ 
+ " Test for invoking 'gf' on a ${VAR} variable
+ func Test_gf()
+   if has("ebcdic")
+     set isfname=@,240-249,/,.,-,_,+,,,$,:,~,{,}
+   else
+     set isfname=@,48-57,/,.,-,_,+,,,$,:,~,{,}
+   endif
+ 
+   call writefile(["Test for gf command"], "Xtest1")
+   if has("unix")
+     call writefile(["    ${CDIR}/Xtest1"], "Xtestgf")
+   else
+     call writefile(["    $TDIR/Xtest1"], "Xtestgf")
+   endif
+   new Xtestgf
+   if has("unix")
+     let $CDIR = "."
+     /CDIR
+   else
+     if has("amiga")
+       let $TDIR = "/testdir"
+     else
+       let $TDIR = "."
+     endif
+     /TDIR
+   endif
+ 
+   normal gf
+   call assert_equal('Xtest1', fnamemodify(bufname(''), ":t"))
+   close!
+ 
+   call delete('Xtest1')
+   call delete('Xtestgf')
+ endfunc
*** ../vim-8.1.1284/src/version.c	2019-05-06 21:46:05.062544448 +0200
--- src/version.c	2019-05-06 21:57:17.606979162 +0200
***************
*** 769,770 ****
--- 769,772 ----
  {   /* Add new patch number below this line */
+ /**/
+     1285,
  /**/

-- 
Biting someone with your natural teeth is "simple assault," while biting
someone with your false teeth is "aggravated assault."
		[real standing law in Louisana, United States of America]

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///