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