Mercurial > vim
annotate src/testdir/test_increment.in @ 7292:ac824bb0b755
Added tag v7.4.951 for changeset 6ffc75d807bd056de7dae782196b42b46e35cb48
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 03 Dec 2015 16:45:05 +0100 |
parents | 05afb5be93bd |
children | ad432f8f68fb |
rev | line source |
---|---|
6868 | 1 Tests for using Ctrl-A/Ctrl-X on visual selections |
2 | |
3 Test cases | |
4 ========== | |
5 | |
6 1) Ctrl-A on visually selected number | |
7 Text: | |
8 foobar-10 | |
6891 | 9 Expected: |
6868 | 10 1) Ctrl-A on start of line: |
11 foobar-9 | |
12 2) Ctrl-A on visually selected "-10": | |
13 foobar-9 | |
14 3) Ctrl-A on visually selected "10": | |
15 foobar-11 | |
16 4) Ctrl-X on visually selected "-10" | |
17 foobar-11 | |
18 5) Ctrl-X on visually selected "10" | |
19 foobar-9 | |
20 | |
21 2) Ctrl-A on visually selected lines | |
22 Text: | |
23 10 | |
24 20 | |
25 30 | |
26 40 | |
27 | |
6891 | 28 Expected: |
6868 | 29 1) Ctrl-A on visually selected lines: |
30 11 | |
31 21 | |
32 31 | |
33 41 | |
34 | |
35 2) Ctrl-X on visually selected lines: | |
36 9 | |
37 19 | |
38 29 | |
39 39 | |
40 | |
41 3) g Ctrl-A on visually selected lines, with non-numbers in between | |
42 Text: | |
43 10 | |
44 | |
45 20 | |
46 | |
47 30 | |
48 | |
49 40 | |
50 | |
6891 | 51 Expected: |
6868 | 52 1) 2 g Ctrl-A on visually selected lines: |
53 12 | |
54 | |
55 24 | |
56 | |
57 36 | |
58 | |
59 48 | |
60 2) 2 g Ctrl-X on visually selected lines | |
61 8 | |
62 | |
63 16 | |
64 | |
65 24 | |
66 | |
67 32 | |
68 | |
69 4) Ctrl-A on non-number | |
70 Text: | |
71 foobar-10 | |
6891 | 72 Expected: |
6868 | 73 1) visually select foobar: |
74 foobar-10 | |
75 | |
6891 | 76 5) g<Ctrl-A> on letter |
77 Test: | |
78 a | |
79 a | |
80 a | |
81 a | |
82 Expected: | |
83 1) g Ctrl-A on visually selected lines | |
84 b | |
85 c | |
86 d | |
87 e | |
88 | |
89 6) g<Ctrl-A> on letter | |
90 Test: | |
91 z | |
92 z | |
93 z | |
94 z | |
95 Expected: | |
96 1) g Ctrl-X on visually selected lines | |
97 y | |
98 x | |
99 w | |
100 v | |
101 | |
102 7) <Ctrl-A> on letter | |
103 Test: | |
104 2 | |
105 1 | |
106 0 | |
107 -1 | |
108 -2 | |
109 | |
110 Expected: | |
111 1) Ctrl-A on visually selected lines | |
112 3 | |
113 2 | |
114 1 | |
115 0 | |
116 -1 | |
117 | |
118 2) Ctrl-X on visually selected lines | |
119 1 | |
120 0 | |
121 -1 | |
122 -2 | |
123 -3 | |
124 8) Block increment on 0x9 | |
125 Text: | |
126 0x9 | |
127 0x9 | |
128 Expected: | |
129 1) Ctrl-A on visually block selected region (cursor at beginning): | |
130 0xa | |
131 0xa | |
132 2) Ctrl-A on visually block selected region (cursor at end) | |
133 0xa | |
134 0xa | |
135 | |
136 9) Increment and redo | |
137 Text: | |
138 2 | |
139 2 | |
140 | |
141 3 | |
142 3 | |
143 | |
144 Expected: | |
145 1) 2 Ctrl-A on first 2 visually selected lines | |
146 4 | |
147 4 | |
148 2) redo (.) on 3 | |
149 5 | |
150 5 | |
151 10) sequentially decrement 1 | |
152 Text: | |
153 1 | |
154 1 | |
155 1 | |
156 1 | |
157 Expected: | |
158 1) g Ctrl-X on visually selected lines | |
159 0 | |
160 -1 | |
161 -2 | |
162 -3 | |
163 | |
164 11) visually block selected indented lines | |
165 Text: | |
166 1 | |
167 1 | |
168 1 | |
169 1 | |
170 Expexted: | |
171 1) g Ctrl-A on block selected indented lines | |
172 2 | |
173 1 | |
174 3 | |
175 4 | |
176 | |
177 12) visually selected several columns | |
178 Text: | |
179 0 0 | |
180 0 0 | |
181 0 0 | |
182 Expected: | |
183 1) 'v' select last zero and first zeroes | |
184 0 1 | |
185 1 0 | |
186 1 0 | |
187 | |
6927 | 188 13) visually selected part of columns |
189 Text: | |
190 max: 100px | |
191 max: 200px | |
192 max: 300px | |
193 max: 400px | |
194 Expected: | |
195 1) 'v' on first two numbers Ctrl-A | |
196 max: 110px | |
197 max: 220px | |
198 max: 330px | |
199 max: 400px | |
200 2) 'v' on first two numbers Ctrl-X | |
201 max: 90px | |
202 max: 190px | |
203 max: 290px | |
204 max: 400px | |
205 | |
206 14) redo in block mode | |
207 Text: | |
208 1 1 | |
209 1 1 | |
210 Expected: | |
211 1) Ctrl-a on first column, redo on second column | |
212 2 2 | |
213 2 2 | |
214 | |
215 15) block select single numbers | |
216 Text: | |
217 101 | |
218 Expected: | |
219 1) Ctrl-a on visually selected zero | |
220 111 | |
221 | |
222 16) increment right aligned numbers | |
223 Text: | |
224 1 | |
225 19 | |
226 119 | |
227 Expected: | |
228 1) Ctrl-a on line selected region | |
229 2 | |
230 20 | |
231 120 | |
232 | |
233 17) block-wise increment and redo | |
234 Text: | |
235 100 | |
236 1 | |
237 | |
238 100 | |
239 1 | |
240 | |
241 Expected: | |
242 1) Ctrl-V j $ on first block, afterwards '.' on second | |
243 101 | |
244 2 | |
245 | |
246 101 | |
247 2 | |
248 | |
249 18) repeat of g<Ctrl-a> | |
250 Text: | |
251 0 | |
252 0 | |
253 0 | |
254 0 | |
255 | |
256 Expected: | |
257 1) V 4j g<ctrl-a>, repeat twice afterwards with . | |
258 3 | |
259 6 | |
260 9 | |
261 12 | |
262 | |
6977 | 263 19) increment on number with nrformat including alpha |
264 Text: | |
265 1 | |
266 1a | |
267 | |
268 Expected: | |
269 1) <Ctrl-V>j$ <ctrl-a> | |
270 2 | |
7011 | 271 2a |
272 | |
273 20) increment a single letter | |
274 Text: | |
275 a | |
276 | |
277 Expected: | |
278 1) <Ctrl-a> and cursor is on a | |
279 b | |
7072
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
280 |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
281 21) block-wise increment on part of hexadecimal |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
282 Text: |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
283 0x123456 |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
284 |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
285 Expected: |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
286 1) Ctrl-V f3 <ctrl-a> |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
287 0x124456 |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
288 |
6927 | 289 |
290 | |
6868 | 291 STARTTEST |
292 :so small.vim | |
6889 | 293 :" |
294 :" Avoid CTRL-X being mapped in Visual mode for MS-Windows | |
295 :vmapclear | |
296 :" | |
6868 | 297 :" Test 1 |
298 :/^S1=/+,/^E1=/-y a | |
6891 | 299 :/^E1=/+put a |
300 :/^E1=/+2put a | |
301 f-v$:/^E1=/+3put a | |
302 f1v$:/^E1=/+4put a | |
303 f-v$:/^E1=/+5put a | |
6868 | 304 f1v$ |
305 | |
6927 | 306 :" Test 2 |
6868 | 307 :/^S2=/+,/^E2=/-y a |
6891 | 308 :/^E2=/+put a |
6927 | 309 V3k$3j:.+put a |
6868 | 310 V3k$ |
311 | |
312 :" Test 3 | |
313 :/^S3=/+,/^E3=/-y a | |
314 :/^E3=/+put a | |
6927 | 315 V6k2g6j:.+put a |
6868 | 316 V6k2g |
317 | |
318 :" Test 4 | |
319 :/^S4=/+,/^E4=/-y a | |
320 :/^E4=/+put a | |
321 vf- | |
322 | |
6891 | 323 :" Test 5 |
324 :set nrformats+=alpha | |
325 :/^S5=/+,/^E5=/-y a | |
326 :/^E5=/+put a | |
327 v3kg | |
328 | |
329 :" Test 6 | |
330 :/^S6=/+,/^E6=/-y a | |
331 :/^E6=/+put a | |
332 v3kg | |
333 | |
334 :" Test 7 | |
6927 | 335 :set nrformats&vim |
6891 | 336 :/^S7=/+,/^E7=/-y a |
337 :/^E7=/+put a | |
6927 | 338 V4k4j:.+put a |
6891 | 339 V4k |
340 | |
341 :" Test 8 | |
342 :/^S8=/+,/^E8=/-y a | |
343 :/^E8=/+put a | |
6927 | 344 kj$j:.+put a |
6891 | 345 k$+ |
346 | |
347 :" Test 9 | |
348 :/^S9=/+,/^E9=/-y a | |
349 :/^E9=/+put a | |
6927 | 350 5kVj23j. |
6891 | 351 |
352 :" Test 10 | |
353 :/^S10=/+,/^E10=/-y a | |
354 :/^E10=/+put a | |
355 V3kg | |
356 | |
357 : Test 11 | |
358 :/^S11=/+,/^E11=/-y a | |
359 :/^E11=/+put a | |
360 3kf13jg | |
361 | |
362 :" Test 12 | |
363 :/^S12=/+,/^E12=/-y a | |
364 :/^E12=/+put a | |
365 2k$v++ | |
366 | |
6927 | 367 :" Test 13 |
368 :/^S13=/+,/^E13=/-y a | |
369 :/^E13=/+put a | |
370 3kf1l2j3j:.+put a | |
371 3kf1l2j | |
372 | |
373 :" Test 14 | |
374 :/^S14=/+,/^E14=/-y a | |
375 :/^E14=/+put a | |
376 kw. | |
377 | |
378 :" Test 15 | |
379 :/^S15=/+,/^E15=/-y a | |
380 :/^E15=/+put a | |
381 lv | |
382 | |
383 :" Test 16 | |
384 :/^S16=/+,/^E16=/-y a | |
385 :/^E16=/+put a | |
386 V3k | |
387 | |
388 :" Test 17 | |
389 :/^S17=/+,/^E17=/-y a | |
390 :/^E17=/+put a | |
391 4kj$2j. | |
392 | |
393 :" Test 18 | |
394 :/^S18=/+,/^E18=/-y a | |
395 :/^E18=/+put a | |
396 V3kg.. | |
397 | |
6977 | 398 :" Test 19 |
399 :set nrformats+=alpha | |
400 :/^S19=/+,/^E19=/-y a | |
401 :/^E19=/+put a | |
402 k$ | |
403 :set nrformats&vim | |
404 | |
7011 | 405 :" Test 20 |
406 :set nrformats+=alpha | |
407 :/^S20=/+,/^E20=/-y a | |
408 :/^E20=/+put a | |
409 :.put =col('.') | |
410 :set nrformats&vim | |
411 | |
7072
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
412 :" Test 21 |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
413 :/^S21=/+,/^E21=/-y a |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
414 :/^E21=/+put a |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
415 :set nrformats&vim |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
416 f3 |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
417 |
6868 | 418 :" Save the report |
419 :/^# Test 1/,$w! test.out | |
420 :qa! | |
421 | |
422 | |
423 # Test 1 | |
424 S1====== | |
425 foobar-10 | |
426 E1====== | |
427 | |
428 | |
429 | |
430 # Test 2 | |
431 S2===== | |
432 10 | |
433 20 | |
434 30 | |
435 40 | |
436 E2===== | |
437 | |
438 | |
439 | |
440 # Test 3 | |
441 S3===== | |
442 10 | |
443 | |
444 20 | |
445 | |
446 30 | |
447 | |
448 40 | |
449 E3===== | |
450 | |
451 | |
452 | |
453 # Test 4 | |
454 S4===== | |
455 foobar-10 | |
456 E4===== | |
457 | |
458 | |
6891 | 459 |
460 # Test 5 | |
461 S5==== | |
462 a | |
463 a | |
464 a | |
465 a | |
466 E5==== | |
467 | |
468 | |
469 # Test 6 | |
470 S6==== | |
471 z | |
472 z | |
473 z | |
474 z | |
475 E6==== | |
476 | |
477 | |
478 | |
479 # Test 7 | |
480 S7==== | |
481 2 | |
482 1 | |
483 0 | |
484 -1 | |
485 -2 | |
486 E7==== | |
487 | |
488 | |
489 | |
490 # Test 8 | |
491 S8==== | |
492 0x9 | |
493 0x9 | |
494 E8==== | |
495 | |
496 | |
497 | |
498 | |
499 # Test 9 | |
500 S9==== | |
501 2 | |
502 2 | |
503 | |
504 3 | |
505 3 | |
506 | |
507 E9==== | |
508 | |
509 | |
510 | |
511 | |
512 # Test 10 | |
513 S10==== | |
514 1 | |
515 1 | |
516 1 | |
517 1 | |
518 E10==== | |
519 | |
520 | |
521 | |
522 | |
523 # Test 11 | |
524 S11==== | |
525 1 | |
526 1 | |
527 1 | |
528 1 | |
529 E11==== | |
530 | |
531 | |
532 | |
533 # Test 12 | |
534 S12==== | |
535 0 0 | |
536 0 0 | |
537 0 0 | |
538 E12==== | |
539 | |
540 | |
541 | |
6927 | 542 # Test 13 |
543 S13==== | |
544 max: 100px | |
545 max: 200px | |
546 max: 300px | |
547 max: 400px | |
548 E13==== | |
549 | |
550 | |
551 | |
552 # Test 14 | |
553 S14==== | |
554 1 1 | |
555 1 1 | |
556 E14==== | |
557 | |
558 | |
559 | |
560 # Test 15 | |
561 S15==== | |
562 101 | |
563 E15==== | |
564 | |
565 | |
566 | |
567 # Test 16 | |
568 S16==== | |
569 1 | |
570 19 | |
571 119 | |
572 E16==== | |
573 | |
574 | |
575 | |
576 # Test 17 | |
577 S17==== | |
578 100 | |
579 1 | |
580 | |
581 100 | |
582 1 | |
583 E17==== | |
584 | |
585 | |
586 # Test 18 | |
587 S18==== | |
588 0 | |
589 0 | |
590 0 | |
591 0 | |
592 E18==== | |
6891 | 593 |
594 | |
595 | |
6977 | 596 # Test 19 |
597 S19==== | |
598 1 | |
599 1a | |
600 E19==== | |
601 | |
602 | |
6891 | 603 |
7011 | 604 # Test 20 |
605 S20==== | |
606 a | |
607 E20==== | |
608 | |
609 | |
610 | |
7072
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
611 # Test 21 |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
612 S21==== |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
613 0x123456 |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
614 E21==== |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
615 |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
616 |
05afb5be93bd
commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
Christian Brabandt <cb@256bit.org>
parents:
7011
diff
changeset
|
617 |
6891 | 618 |
6868 | 619 ENDTEST |
620 |