summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1214
blob: f2212da2012e0f36f3f4666b137fa7c6889ce56d (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
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1214
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.1214
Problem:    Old style tests.
Solution:   Move tests from test14 to new style test files. (Yegappan
            Lakshmanan, closes #4308)
Files:	    src/Makefile, src/testdir/Make_all.mak, src/testdir/Make_vms.mms,
            src/testdir/test14.in, src/testdir/test14.ok,
            src/testdir/test_edit.vim, src/testdir/test_normal.vim,
            src/testdir/test_search.vim, src/testdir/test_substitute.vim,
            src/testdir/test_visual.vim


*** ../vim-8.1.1213/src/Makefile	2019-04-27 13:03:20.000715982 +0200
--- src/Makefile	2019-04-27 17:35:39.801824116 +0200
***************
*** 2175,2181 ****
  # These do not depend on the executable, compile it when needed.
  test1 \
  	test_eval \
! 	test3 test14 test17 \
  	test29 test30 test37 test39 \
  	test42 test44 test48 test49 \
  	test52 test59 \
--- 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 \
*** ../vim-8.1.1213/src/testdir/Make_all.mak	2019-04-25 20:28:53.327979592 +0200
--- src/testdir/Make_all.mak	2019-04-27 17:35:39.801824116 +0200
***************
*** 14,20 ****
  # Tests that run on all systems.
  SCRIPTS_ALL = \
  	test3.out \
- 	test14.out \
  	test29.out \
  	test37.out \
  	test39.out \
--- 14,19 ----
*** ../vim-8.1.1213/src/testdir/Make_vms.mms	2019-04-25 20:28:53.327979592 +0200
--- src/testdir/Make_vms.mms	2019-04-27 17:35:39.805824096 +0200
***************
*** 74,80 ****
  .SUFFIXES : .out .in
  
  SCRIPT = test1.out test3.out \
-        test14.out \
         test29.out \
         test30.out test37.out test39.out \
         test42.out test44.out test48.out test49.out \
--- 74,79 ----
*** ../vim-8.1.1213/src/testdir/test14.in	2017-03-08 22:48:59.000000000 +0100
--- src/testdir/test14.in	1970-01-01 01:00:00.000000000 +0100
***************
*** 1,100 ****
- Tests for "vaBiB", end could be wrong.
- Also test ":s/pat/sub/" with different ~s in sub.
- Also test for ^Vxff and ^Vo123 in Insert mode.
- Also test "[m", "]m", "[M" and "]M"
- Also test search()
- 
- STARTTEST
- :so small.vim
- :set belloff=all
- /Start cursor here
- vaBiBD:?Bug?,/Piece/-2w! test.out
- /^- Bug
- :s/u/~u~/
- :s/i/~u~/
- :s/o/~~~/
- :.w >>test.out
- :if has("ebcdic")
- : let tt = "o\<C-V>193\<C-V>xc2\<C-V>o303 \<C-V>90a\<C-V>xfg\<C-V>o578\<Esc>"
- :else
- : let tt = "o\<C-V>65\<C-V>x42\<C-V>o103 \<C-V>33a\<C-V>xfg\<C-V>o78\<Esc>"
- :endif
- :exe "normal " . tt
- :unlet tt
- :.w >>test.out
- :set vb
- /^Piece
- 2]maA:.w >>test.out
- j]maB:.w >>test.out
- ]maC:.w >>test.out
- [maD:.w >>test.out
- k2[maE:.w >>test.out
- 3[maF:.w >>test.out
- ]MaG:.w >>test.out
- j2]MaH:.w >>test.out
- ]M]MaI:.w >>test.out
- 2[MaJ:.w >>test.out
- k[MaK:.w >>test.out
- 3[MaL:.w >>test.out
- :"
- /^foobar
- :let startline = line('.')
- :call search('foobar', 'c')
- :call append(line('$'), line('.') - startline)
- j:call search('^$', 'c')
- :call append(line('$'), line('.') - startline)
- :call search('^$', 'bc')
- :call append(line('$'), line('.') - startline)
- /two
- :call search('.', 'c')
- :call append(line('$'), getline('.')[col('.') - 1:])
- :"
- /^substitute
- :s/foo/bar/
- :$put =@/
- /^substitute
- :keeppatterns s/asdf/xyz/
- :$put =@/
- /^substitute
- Y:$put =@0
- /bar /e
- :$put =@0
- -:keeppatterns /xyz
- 0dn:/^search()/,$w >>test.out
- :qa!
- ENDTEST
- 
- - Bug in "vPPPP" on this text (Webb):
- 	{
- 		cmd;
- 		{
- 			cmd;	/* <-- Start cursor here */
- 			{
- 			}
- 		}
- 	}
- 
- Piece of Java
- {
- 	tt m1 {
- 		t1;
- 	} e1
- 
- 	tt m2 {
- 		t2;
- 	} e2
- 
- 	tt m3 {
- 		if (x)
- 		{
- 			t3;
- 		}
- 	} e3
- }
- 
- foobar
- 
- substitute foo asdf
- 
- one two
- search()
--- 0 ----
*** ../vim-8.1.1213/src/testdir/test14.ok	2014-01-14 21:16:23.000000000 +0100
--- src/testdir/test14.ok	1970-01-01 01:00:00.000000000 +0100
***************
*** 1,26 ****
- - Bug in "vPPPP" on this text (Webb):
- 	{
- 	}
- - Bug uuun "vPPPP" uuuuuuuuun this text (Webb):
- ABC !ag8
- 	tt m1 {A
- 	tt m2 {B
- 	tt m3 {C
- 	tt m3 {DC
- 	tt m1 {EA
- {F
- 	}G e1
- 	}H e3
- }I
- 	}JH e3
- 	}K e2
- {LF
- search()
- 0
- 1
- 1
- two
- foo
- ^substitute
- substitute bar xyz
- xyz
--- 0 ----
*** ../vim-8.1.1213/src/testdir/test_edit.vim	2019-03-16 18:11:03.646997858 +0100
--- src/testdir/test_edit.vim	2019-04-27 17:35:39.805824096 +0200
***************
*** 1447,1449 ****
--- 1447,1465 ----
    au! InsertLeave
    iunmap x
  endfunc
+ 
+ " Test for inserting characters using CTRL-V followed by a number.
+ func Test_edit_special_chars()
+   new
+ 
+   if has("ebcdic")
+     let t = "o\<C-V>193\<C-V>xc2\<C-V>o303 \<C-V>90a\<C-V>xfg\<C-V>o578\<Esc>"
+   else
+     let t = "o\<C-V>65\<C-V>x42\<C-V>o103 \<C-V>33a\<C-V>xfg\<C-V>o78\<Esc>"
+   endif
+ 
+   exe "normal " . t
+   call assert_equal("ABC !a\<C-O>g\<C-G>8", getline(2))
+ 
+   close!
+ endfunc
*** ../vim-8.1.1213/src/testdir/test_normal.vim	2019-03-25 23:16:30.600492534 +0100
--- src/testdir/test_normal.vim	2019-04-27 17:35:39.809824077 +0200
***************
*** 1358,1368 ****
      bw!
      return
    endif
!   set keywordprg=man\ --pager=cat
    " Test for using man
    2
    let a = execute('unsilent norm! K')
!   call assert_match("man --pager=cat 'man'", a)
  
    " clean up
    let &keywordprg = k
--- 1358,1378 ----
      bw!
      return
    endif
! 
!   if has('mac')
!     " In MacOS, the option for specifying a pager is different
!     set keywordprg=man\ -P\ cat
!   else
!     set keywordprg=man\ --pager=cat
!   endif
    " Test for using man
    2
    let a = execute('unsilent norm! K')
!   if has('mac')
!     call assert_match("man -P cat 'man'", a)
!   else
!     call assert_match("man --pager=cat 'man'", a)
!   endif
  
    " clean up
    let &keywordprg = k
***************
*** 2559,2561 ****
--- 2569,2649 ----
  
    bwipe!
  endfunc
+ 
+ " Test for '[m', ']m', '[M' and ']M'
+ " Jumping to beginning and end of methods in Java-like languages
+ func Test_java_motion()
+   new
+   a
+ Piece of Java
+ {
+ 	tt m1 {
+ 		t1;
+ 	} e1
+ 
+ 	tt m2 {
+ 		t2;
+ 	} e2
+ 
+ 	tt m3 {
+ 		if (x)
+ 		{
+ 			t3;
+ 		}
+ 	} e3
+ }
+ .
+ 
+   normal gg
+ 
+   normal 2]maA
+   call assert_equal("\ttt m1 {A", getline('.'))
+   call assert_equal([3, 9, 16], [line('.'), col('.'), virtcol('.')])
+ 
+   normal j]maB
+   call assert_equal("\ttt m2 {B", getline('.'))
+   call assert_equal([7, 9, 16], [line('.'), col('.'), virtcol('.')])
+ 
+   normal ]maC
+   call assert_equal("\ttt m3 {C", getline('.'))
+   call assert_equal([11, 9, 16], [line('.'), col('.'), virtcol('.')])
+ 
+   normal [maD
+   call assert_equal("\ttt m3 {DC", getline('.'))
+   call assert_equal([11, 9, 16], [line('.'), col('.'), virtcol('.')])
+ 
+   normal k2[maE
+   call assert_equal("\ttt m1 {EA", getline('.'))
+   call assert_equal([3, 9, 16], [line('.'), col('.'), virtcol('.')])
+ 
+   normal 3[maF
+   call assert_equal("{F", getline('.'))
+   call assert_equal([2, 2, 2], [line('.'), col('.'), virtcol('.')])
+ 
+   normal ]MaG
+   call assert_equal("\t}G e1", getline('.'))
+   call assert_equal([5, 3, 10], [line('.'), col('.'), virtcol('.')])
+ 
+   normal j2]MaH
+   call assert_equal("\t}H e3", getline('.'))
+   call assert_equal([16, 3, 10], [line('.'), col('.'), virtcol('.')])
+ 
+   normal ]M]M
+   normal aI
+   call assert_equal("}I", getline('.'))
+   call assert_equal([17, 2, 2], [line('.'), col('.'), virtcol('.')])
+ 
+   normal 2[MaJ
+   call assert_equal("\t}JH e3", getline('.'))
+   call assert_equal([16, 3, 10], [line('.'), col('.'), virtcol('.')])
+ 
+   normal k[MaK
+   call assert_equal("\t}K e2", getline('.'))
+   call assert_equal([9, 3, 10], [line('.'), col('.'), virtcol('.')])
+ 
+   normal 3[MaL
+   call assert_equal("{LF", getline('.'))
+   call assert_equal([2, 2, 2], [line('.'), col('.'), virtcol('.')])
+ 
+   close!
+ endfunc
*** ../vim-8.1.1213/src/testdir/test_search.vim	2019-04-11 13:45:53.125298538 +0200
--- src/testdir/test_search.vim	2019-04-27 17:35:39.809824077 +0200
***************
*** 1265,1267 ****
--- 1265,1291 ----
    set incsearch&
    bwipe!
  endfunc
+ 
+ " Test for the search() function with match at the cursor position
+ func Test_search_match_at_curpos()
+   new
+   call append(0, ['foobar', '', 'one two', ''])
+ 
+   normal gg
+ 
+   call search('foobar', 'c')
+   call assert_equal([1, 1], [line('.'), col('.')])
+ 
+   normal j
+   call search('^$', 'c')
+   call assert_equal([2, 1], [line('.'), col('.')])
+ 
+   call search('^$', 'bc')
+   call assert_equal([2, 1], [line('.'), col('.')])
+ 
+   exe "normal /two\<CR>"
+   call search('.', 'c')
+   call assert_equal([3, 5], [line('.'), col('.')])
+ 
+   close!
+ endfunc
*** ../vim-8.1.1213/src/testdir/test_substitute.vim	2019-03-27 22:53:49.919226659 +0100
--- src/testdir/test_substitute.vim	2019-04-27 17:35:39.813824056 +0200
***************
*** 640,642 ****
--- 640,691 ----
  
    bwipe!
  endfunc
+ 
+ " Test ":s/pat/sub/" with different ~s in sub.
+ func Test_replace_with_tilde()
+   new
+   " Set the last replace string to empty
+   s/^$//
+   call append(0, ['- Bug in "vPPPP" on this text:'])
+   normal gg
+   s/u/~u~/
+   call assert_equal('- Bug in "vPPPP" on this text:', getline(1))
+   s/i/~u~/
+   call assert_equal('- Bug uuun "vPPPP" on this text:', getline(1))
+   s/o/~~~/
+   call assert_equal('- Bug uuun "vPPPP" uuuuuuuuun this text:', getline(1))
+   close!
+ endfunc
+ 
+ func Test_replace_keeppatterns()
+   new
+   a
+ foobar
+ 
+ substitute foo asdf
+ 
+ one two
+ .
+ 
+   normal gg
+   /^substitute
+   s/foo/bar/
+   call assert_equal('foo', @/)
+   call assert_equal('substitute bar asdf', getline('.'))
+ 
+   /^substitute
+   keeppatterns s/asdf/xyz/
+   call assert_equal('^substitute', @/)
+   call assert_equal('substitute bar xyz', getline('.'))
+ 
+   exe "normal /bar /e\<CR>"
+   call assert_equal(15, col('.'))
+   normal -
+   keeppatterns /xyz
+   call assert_equal('bar ', @/)
+   call assert_equal('substitute bar xyz', getline('.'))
+   exe "normal 0dn"
+   call assert_equal('xyz', getline('.'))
+ 
+   close!
+ endfunc
*** ../vim-8.1.1213/src/testdir/test_visual.vim	2019-03-07 11:25:24.455856096 +0100
--- src/testdir/test_visual.vim	2019-04-27 17:35:39.813824056 +0200
***************
*** 404,406 ****
--- 404,430 ----
    bwipe!
    au! InsertLeave
  endfunc
+ 
+ " Tests for "vaBiB", end could be wrong.
+ func Test_Visual_Block()
+   new
+   a
+ - Bug in "vPPPP" on this text:
+ 	{
+ 		cmd;
+ 		{
+ 			cmd;\t/* <-- Start cursor here */
+ 			{
+ 			}
+ 		}
+ 	}
+ .
+   normal gg
+   call search('Start cursor here')
+   normal vaBiBD
+   call assert_equal(['- Bug in "vPPPP" on this text:',
+ 	      \ "\t{",
+ 	      \ "\t}"], getline(1, '$'))
+ 
+   close!
+ endfunc
*** ../vim-8.1.1213/src/version.c	2019-04-27 17:57:28.079905467 +0200
--- src/version.c	2019-04-27 17:58:31.699611434 +0200
***************
*** 769,770 ****
--- 769,772 ----
  {   /* Add new patch number below this line */
+ /**/
+     1214,
  /**/

-- 
ARTHUR:  Well, I can't just call you `Man'.
DENNIS:  Well, you could say `Dennis'.
ARTHUR:  Well, I didn't know you were called `Dennis.'
DENNIS:  Well, you didn't bother to find out, did you?
                                  The Quest for the Holy Grail (Monty Python)

 /// 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    ///