293
|
1 Tests for :sort command. vim: set ft=vim :
|
|
2
|
|
3 STARTTEST
|
|
4 :so small.vim
|
|
5 :"
|
826
|
6 :/^t01:/+1,/^t02/-1sort
|
|
7 :/^t02:/+1,/^t03/-1sort n
|
|
8 :/^t03:/+1,/^t04/-1sort x
|
|
9 :/^t04:/+1,/^t05/-1sort u
|
|
10 :/^t05:/+1,/^t06/-1sort!
|
|
11 :/^t06:/+1,/^t07/-1sort! n
|
|
12 :/^t07:/+1,/^t08/-1sort! u
|
|
13 :/^t08:/+1,/^t09/-1sort o
|
|
14 :/^t09:/+1,/^t10/-1sort! x
|
|
15 :/^t10:/+1,/^t11/-1sort/./
|
|
16 :/^t11:/+1,/^t12/-1sort/../
|
|
17 :/^t12:/+1,/^t13/-1sort/../u
|
|
18 :/^t13:/+1,/^t14/-1sort/./n
|
|
19 :/^t14:/+1,/^t15/-1sort/./r
|
|
20 :/^t15:/+1,/^t16/-1sort/../r
|
|
21 :/^t16:/+1,/^t17/-1sort/./rn
|
|
22 :/^t17:/+1,/^t18/-1sort/\d/
|
|
23 :/^t18:/+1,/^t19/-1sort/\d/r
|
|
24 :/^t19:/+1,/^t20/-1sort/\d/n
|
|
25 :/^t20:/+1,/^t21/-1sort/\d/rn
|
|
26 :/^t21:/+1,/^t22/-1sort/\d\d/
|
|
27 :/^t22:/+1,/^t23/-1sort/\d\d/n
|
|
28 :/^t23:/+1,/^t24/-1sort/\d\d/x
|
|
29 :/^t24:/+1,/^t25/-1sort/\d\d/r
|
|
30 :/^t25:/+1,/^t26/-1sort/\d\d/rn
|
|
31 :/^t26:/+1,/^t27/-1sort/\d\d/rx
|
|
32 :/^t27:/+1,/^t28/-1sort no
|
|
33 :/^t01:/,$wq! test.out
|
293
|
34 ENDTEST
|
|
35
|
826
|
36 t01: alphebetical
|
|
37 abc
|
|
38 ab
|
|
39 a
|
|
40 a321
|
|
41 a123
|
|
42 a122
|
|
43 b321
|
|
44 b123
|
|
45 c123d
|
|
46 123b
|
|
47 c321d
|
|
48 b322b
|
|
49 b321
|
|
50 b321b
|
|
51
|
|
52
|
|
53 t02: numeric
|
|
54 abc
|
|
55 ab
|
|
56 a321
|
|
57 a123
|
|
58 a122
|
2606
|
59 a
|
|
60 x-22
|
826
|
61 b321
|
|
62 b123
|
2606
|
63
|
826
|
64 c123d
|
2606
|
65 -24
|
826
|
66 123b
|
|
67 c321d
|
2606
|
68 0
|
826
|
69 b322b
|
|
70 b321
|
|
71 b321b
|
|
72
|
|
73
|
|
74 t03: hexadecimal
|
|
75 abc
|
|
76 ab
|
|
77 a
|
|
78 a321
|
|
79 a123
|
|
80 a122
|
|
81 b321
|
|
82 b123
|
|
83 c123d
|
|
84 123b
|
|
85 c321d
|
|
86 b322b
|
|
87 b321
|
|
88 b321b
|
|
89
|
|
90
|
|
91 t04: alpha, unique
|
|
92 abc
|
|
93 ab
|
|
94 a
|
|
95 a321
|
|
96 a123
|
|
97 a122
|
|
98 b321
|
|
99 b123
|
|
100 c123d
|
|
101 123b
|
|
102 c321d
|
|
103 b322b
|
|
104 b321
|
|
105 b321b
|
|
106
|
|
107
|
|
108 t05: alpha, reverse
|
|
109 abc
|
|
110 ab
|
|
111 a
|
|
112 a321
|
|
113 a123
|
|
114 a122
|
|
115 b321
|
|
116 b123
|
|
117 c123d
|
|
118 123b
|
|
119 c321d
|
|
120 b322b
|
|
121 b321
|
|
122 b321b
|
|
123
|
|
124
|
|
125 t06: numeric, reverse
|
|
126 abc
|
|
127 ab
|
|
128 a
|
|
129 a321
|
|
130 a123
|
|
131 a122
|
|
132 b321
|
|
133 b123
|
|
134 c123d
|
|
135 123b
|
|
136 c321d
|
|
137 b322b
|
|
138 b321
|
|
139 b321b
|
|
140
|
|
141
|
|
142 t07: unique, reverse
|
|
143 abc
|
|
144 ab
|
|
145 a
|
|
146 a321
|
|
147 a123
|
|
148 a122
|
|
149 b321
|
|
150 b123
|
|
151 c123d
|
|
152 123b
|
|
153 c321d
|
|
154 b322b
|
|
155 b321
|
|
156 b321b
|
|
157
|
|
158
|
|
159 t08: octal
|
|
160 abc
|
|
161 ab
|
|
162 a
|
|
163 a321
|
|
164 a123
|
|
165 a122
|
|
166 b321
|
|
167 b123
|
|
168 c123d
|
|
169 123b
|
|
170 c321d
|
|
171 b322b
|
|
172 b321
|
|
173 b321b
|
|
174
|
|
175
|
|
176 t09: reverse, hexadecimal
|
|
177 abc
|
|
178 ab
|
|
179 a
|
|
180 a321
|
|
181 a123
|
|
182 a122
|
|
183 b321
|
|
184 b123
|
|
185 c123d
|
|
186 123b
|
|
187 c321d
|
|
188 b322b
|
|
189 b321
|
|
190 b321b
|
|
191
|
|
192
|
|
193 t10: alpha, skip first character
|
|
194 abc
|
|
195 ab
|
|
196 a
|
|
197 a321
|
|
198 a123
|
|
199 a122
|
|
200 b321
|
|
201 b123
|
|
202 c123d
|
|
203 123b
|
|
204 c321d
|
|
205 b322b
|
|
206 b321
|
|
207 b321b
|
|
208
|
|
209
|
|
210 t11: alpha, skip first 2 characters
|
|
211 abc
|
|
212 ab
|
|
213 a
|
|
214 a321
|
|
215 a123
|
|
216 a122
|
|
217 b321
|
|
218 b123
|
|
219 c123d
|
|
220 123b
|
|
221 c321d
|
|
222 b322b
|
|
223 b321
|
|
224 b321b
|
|
225
|
|
226
|
|
227 t12: alpha, unique, skip first 2 characters
|
|
228 abc
|
|
229 ab
|
|
230 a
|
|
231 a321
|
|
232 a123
|
|
233 a122
|
|
234 b321
|
|
235 b123
|
|
236 c123d
|
|
237 123b
|
|
238 c321d
|
|
239 b322b
|
|
240 b321
|
|
241 b321b
|
|
242
|
|
243
|
|
244 t13: numeric, skip first character
|
|
245 abc
|
|
246 ab
|
|
247 a
|
|
248 a321
|
|
249 a123
|
|
250 a122
|
|
251 b321
|
|
252 b123
|
|
253 c123d
|
|
254 123b
|
|
255 c321d
|
|
256 b322b
|
|
257 b321
|
|
258 b321b
|
|
259
|
|
260
|
|
261 t14: alpha, sort on first character
|
|
262 abc
|
|
263 ab
|
|
264 a
|
|
265 a321
|
|
266 a123
|
|
267 a122
|
|
268 b321
|
|
269 b123
|
|
270 c123d
|
|
271 123b
|
|
272 c321d
|
|
273 b322b
|
|
274 b321
|
|
275 b321b
|
|
276
|
|
277
|
|
278 t15: alpha, sort on first 2 characters
|
|
279 abc
|
|
280 ab
|
|
281 a
|
|
282 a321
|
|
283 a123
|
|
284 a122
|
|
285 b321
|
|
286 b123
|
|
287 c123d
|
|
288 123b
|
|
289 c321d
|
|
290 b322b
|
|
291 b321
|
|
292 b321b
|
|
293
|
|
294
|
|
295 t16: numeric, sort on first character
|
|
296 abc
|
|
297 ab
|
|
298 a
|
|
299 a321
|
|
300 a123
|
|
301 a122
|
|
302 b321
|
|
303 b123
|
|
304 c123d
|
|
305 123b
|
|
306 c321d
|
|
307 b322b
|
|
308 b321
|
|
309 b321b
|
|
310
|
|
311
|
|
312 t17: alpha, skip past first digit
|
|
313 abc
|
|
314 ab
|
|
315 a
|
|
316 a321
|
|
317 a123
|
|
318 a122
|
|
319 b321
|
|
320 b123
|
|
321 c123d
|
|
322 123b
|
|
323 c321d
|
|
324 b322b
|
|
325 b321
|
|
326 b321b
|
|
327
|
|
328
|
|
329 t18: alpha, sort on first digit
|
|
330 abc
|
|
331 ab
|
|
332 a
|
|
333 a321
|
|
334 a123
|
|
335 a122
|
|
336 b321
|
|
337 b123
|
|
338 c123d
|
|
339 123b
|
|
340 c321d
|
|
341 b322b
|
|
342 b321
|
|
343 b321b
|
|
344
|
|
345
|
|
346 t19: numeric, skip past first digit
|
|
347 abc
|
|
348 ab
|
|
349 a
|
|
350 a321
|
|
351 a123
|
|
352 a122
|
|
353 b321
|
|
354 b123
|
|
355 c123d
|
|
356 123b
|
|
357 c321d
|
|
358 b322b
|
|
359 b321
|
|
360 b321b
|
|
361
|
|
362
|
|
363 t20: numeric, sort on first digit
|
|
364 abc
|
|
365 ab
|
|
366 a
|
|
367 a321
|
|
368 a123
|
|
369 a122
|
|
370 b321
|
|
371 b123
|
|
372 c123d
|
|
373 123b
|
|
374 c321d
|
|
375 b322b
|
|
376 b321
|
|
377 b321b
|
|
378
|
|
379
|
|
380 t21: alpha, skip past first 2 digits
|
|
381 abc
|
|
382 ab
|
|
383 a
|
|
384 a321
|
|
385 a123
|
|
386 a122
|
|
387 b321
|
|
388 b123
|
|
389 c123d
|
|
390 123b
|
|
391 c321d
|
|
392 b322b
|
|
393 b321
|
|
394 b321b
|
|
395
|
|
396
|
|
397 t22: numeric, skip past first 2 digits
|
|
398 abc
|
|
399 ab
|
|
400 a
|
|
401 a321
|
|
402 a123
|
|
403 a122
|
|
404 b321
|
|
405 b123
|
|
406 c123d
|
|
407 123b
|
|
408 c321d
|
|
409 b322b
|
|
410 b321
|
|
411 b321b
|
|
412
|
|
413
|
|
414 t23: hexadecimal, skip past first 2 digits
|
|
415 abc
|
|
416 ab
|
|
417 a
|
|
418 a321
|
|
419 a123
|
|
420 a122
|
|
421 b321
|
|
422 b123
|
|
423 c123d
|
|
424 123b
|
|
425 c321d
|
|
426 b322b
|
|
427 b321
|
|
428 b321b
|
|
429
|
|
430
|
|
431 t24: alpha, sort on first 2 digits
|
|
432 abc
|
|
433 ab
|
|
434 a
|
|
435 a321
|
|
436 a123
|
|
437 a122
|
|
438 b321
|
|
439 b123
|
|
440 c123d
|
|
441 123b
|
|
442 c321d
|
|
443 b322b
|
|
444 b321
|
|
445 b321b
|
|
446
|
|
447
|
|
448 t25: numeric, sort on first 2 digits
|
|
449 abc
|
|
450 ab
|
|
451 a
|
|
452 a321
|
|
453 a123
|
|
454 a122
|
|
455 b321
|
|
456 b123
|
|
457 c123d
|
|
458 123b
|
|
459 c321d
|
|
460 b322b
|
|
461 b321
|
|
462 b321b
|
|
463
|
|
464
|
|
465 t26: hexadecimal, sort on first 2 digits
|
|
466 abc
|
|
467 ab
|
|
468 a
|
|
469 a321
|
|
470 a123
|
|
471 a122
|
|
472 b321
|
|
473 b123
|
|
474 c123d
|
|
475 123b
|
|
476 c321d
|
|
477 b322b
|
|
478 b321
|
|
479 b321b
|
|
480
|
|
481
|
|
482 t27: wrong arguments
|
|
483 abc
|
|
484 ab
|
|
485 a
|
|
486 a321
|
|
487 a123
|
|
488 a122
|
|
489 b321
|
|
490 b123
|
|
491 c123d
|
|
492 123b
|
|
493 c321d
|
|
494 b322b
|
|
495 b321
|
|
496 b321b
|
|
497
|
|
498
|
|
499 t28: done
|
|
500
|