Mercurial > vim
annotate src/testdir/test58.in @ 7441:7017b495ca53 v7.4.1024
commit https://github.com/vim/vim/commit/d5c899a3f1d67a220e571dadf90dde1bbd41e166
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 2 15:07:02 2016 +0100
patch 7.4.1024
Problem: Interfaces for MS-Windows are outdated.
Solution: Use Python 2.7.10, Python 3.4.4, Perl 5.22, TCL 8.6.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 02 Jan 2016 15:15:04 +0100 |
parents | 7aca84c0cd37 |
children | ad432f8f68fb |
rev | line source |
---|---|
389 | 1 Tests for spell checking. vim: set ft=vim : |
2 | |
3 STARTTEST | |
4 :so small.vim | |
5 :" | |
415 | 6 :" Don't want to depend on the locale from the environment |
389 | 7 :set enc=latin1 |
415 | 8 :e! |
389 | 9 :" |
5204
7aca84c0cd37
updated for version 7.4a.028
Bram Moolenaar <bram@vim.org>
parents:
1405
diff
changeset
|
10 :" Check using z= in new buffer (crash fixed by patch 7.4a.028). |
7aca84c0cd37
updated for version 7.4a.028
Bram Moolenaar <bram@vim.org>
parents:
1405
diff
changeset
|
11 :set maxmem=512 spell |
7aca84c0cd37
updated for version 7.4a.028
Bram Moolenaar <bram@vim.org>
parents:
1405
diff
changeset
|
12 iasdz=:" |
7aca84c0cd37
updated for version 7.4a.028
Bram Moolenaar <bram@vim.org>
parents:
1405
diff
changeset
|
13 :" |
500 | 14 :" Function to test .aff/.dic with list of good and bad words. |
15 :func TestOne(aff, dic) | |
16 set spellfile= | |
17 $put ='' | |
18 $put ='test '. a:aff . '-' . a:dic | |
19 " Generate a .spl file from a .dic and .aff file. | |
20 exe '1;/^' . a:aff . 'affstart/+1,/^' . a:aff . 'affend/-1w! Xtest.aff' | |
21 exe '1;/^' . a:dic . 'dicstart/+1,/^' . a:dic . 'dicend/-1w! Xtest.dic' | |
22 mkspell! Xtest Xtest | |
23 " use that spell file | |
24 set spl=Xtest.latin1.spl spell | |
25 " list all valid words | |
26 spelldump | |
27 %yank | |
28 quit | |
29 $put | |
30 $put ='-------' | |
31 " find all bad words and suggestions for them | |
32 exe '1;/^' . a:aff . 'good:' | |
33 normal 0f:]s | |
34 let prevbad = '' | |
35 while 1 | |
533 | 36 let [bad, a] = spellbadword() |
500 | 37 if bad == '' || bad == prevbad || bad == 'badend' |
38 break | |
39 endif | |
40 let prevbad = bad | |
41 let lst = spellsuggest(bad, 3) | |
42 normal mm | |
43 $put =bad | |
44 $put =string(lst) | |
45 normal `m]s | |
46 endwhile | |
391 | 47 endfunc |
500 | 48 :" |
49 :call TestOne('1', '1') | |
389 | 50 :$put =soundfold('goobledygoook') |
51 :$put =soundfold('kóopërÿnôven') | |
52 :$put =soundfold('oeverloos gezwets edale') | |
53 :" | |
500 | 54 :" |
389 | 55 :" and now with SAL instead of SOFO items; test automatic reloading |
500 | 56 gg:/^affstart_sal/+1,/^affend_sal/-1w! Xtest.aff |
389 | 57 :mkspell! Xtest Xtest |
58 :$put =soundfold('goobledygoook') | |
59 :$put =soundfold('kóopërÿnôven') | |
60 :$put =soundfold('oeverloos gezwets edale') | |
61 :" | |
62 :" also use an addition file | |
63 gg:/^addstart/+1,/^addend/-1w! Xtest.latin1.add | |
64 :mkspell! Xtest.latin1.add.spl Xtest.latin1.add | |
65 :set spellfile=Xtest.latin1.add | |
66 /^test2: | |
533 | 67 ]s:let [str, a] = spellbadword() |
389 | 68 :$put =str |
419 | 69 :set spl=Xtest_us.latin1.spl |
389 | 70 /^test2: |
533 | 71 ]smm:let [str, a] = spellbadword() |
389 | 72 :$put =str |
533 | 73 `m]s:let [str, a] = spellbadword() |
389 | 74 :$put =str |
419 | 75 :set spl=Xtest_gb.latin1.spl |
389 | 76 /^test2: |
533 | 77 ]smm:let [str, a] = spellbadword() |
389 | 78 :$put =str |
533 | 79 `m]s:let [str, a] = spellbadword() |
389 | 80 :$put =str |
419 | 81 :set spl=Xtest_nz.latin1.spl |
389 | 82 /^test2: |
533 | 83 ]smm:let [str, a] = spellbadword() |
389 | 84 :$put =str |
533 | 85 `m]s:let [str, a] = spellbadword() |
389 | 86 :$put =str |
419 | 87 :set spl=Xtest_ca.latin1.spl |
389 | 88 /^test2: |
533 | 89 ]smm:let [str, a] = spellbadword() |
389 | 90 :$put =str |
533 | 91 `m]s:let [str, a] = spellbadword() |
389 | 92 :$put =str |
1405 | 93 :unlet str a |
389 | 94 :" |
391 | 95 :" Postponed prefixes |
500 | 96 :call TestOne('2', '1') |
391 | 97 :" |
500 | 98 :" Compound words |
99 :call TestOne('3', '3') | |
100 :call TestOne('4', '4') | |
501 | 101 :call TestOne('5', '5') |
102 :call TestOne('6', '6') | |
103 :call TestOne('7', '7') | |
489 | 104 :" |
704 | 105 :" NOSLITSUGS |
106 :call TestOne('8', '8') | |
107 :" | |
1405 | 108 :" clean up for valgrind |
109 :delfunc TestOne | |
110 :set spl= enc=latin1 | |
111 :" | |
389 | 112 gg:/^test output:/,$wq! test.out |
113 ENDTEST | |
114 | |
500 | 115 1affstart |
389 | 116 SET ISO8859-1 |
117 TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ | |
118 | |
119 FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ | |
120 LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ | |
121 UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ | |
122 | |
123 SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ¿ | |
124 SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep? | |
125 | |
126 MIDWORD '- | |
127 | |
128 KEP = | |
129 RAR ? | |
130 BAD ! | |
131 | |
132 PFX I N 1 | |
133 PFX I 0 in . | |
134 | |
135 PFX O Y 1 | |
136 PFX O 0 out . | |
137 | |
138 SFX S Y 2 | |
139 SFX S 0 s [^s] | |
140 SFX S 0 es s | |
141 | |
391 | 142 SFX N N 3 |
143 SFX N 0 en [^n] | |
144 SFX N 0 nen n | |
145 SFX N 0 n . | |
146 | |
389 | 147 REP 3 |
148 REP g ch | |
149 REP ch g | |
150 REP svp s.v.p. | |
151 | |
152 MAP 9 | |
153 MAP aàáâãäå | |
154 MAP eèéêë | |
155 MAP iìíîï | |
156 MAP oòóôõö | |
157 MAP uùúûü | |
158 MAP nñ | |
159 MAP cç | |
160 MAP yÿý | |
161 MAP sß | |
500 | 162 1affend |
163 | |
164 1good: wrong OK puts. Test the end | |
165 bad: inputs comment ok Ok. test déôl end the | |
166 badend | |
389 | 167 |
500 | 168 1dicstart |
169 123456 | |
170 test/NO | |
171 # comment | |
172 wrong | |
173 Comment | |
174 OK | |
175 uk | |
176 put/ISO | |
177 the end | |
178 deol | |
179 déôr | |
180 1dicend | |
181 | |
182 affstart_sal | |
389 | 183 SET ISO8859-1 |
184 TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ | |
185 | |
186 FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ | |
187 LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ | |
188 UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ | |
189 | |
190 MIDWORD '- | |
191 | |
192 KEP = | |
193 RAR ? | |
194 BAD ! | |
195 | |
196 PFX I N 1 | |
197 PFX I 0 in . | |
198 | |
199 PFX O Y 1 | |
200 PFX O 0 out . | |
201 | |
202 SFX S Y 2 | |
203 SFX S 0 s [^s] | |
204 SFX S 0 es s | |
205 | |
391 | 206 SFX N N 3 |
207 SFX N 0 en [^n] | |
208 SFX N 0 nen n | |
209 SFX N 0 n . | |
210 | |
389 | 211 REP 3 |
212 REP g ch | |
213 REP ch g | |
214 REP svp s.v.p. | |
215 | |
216 MAP 9 | |
217 MAP aàáâãäå | |
218 MAP eèéêë | |
219 MAP iìíîï | |
220 MAP oòóôõö | |
221 MAP uùúûü | |
222 MAP nñ | |
223 MAP cç | |
224 MAP yÿý | |
225 MAP sß | |
226 | |
227 SAL AH(AEIOUY)-^ *H | |
228 SAL AR(AEIOUY)-^ *R | |
229 SAL A(HR)^ * | |
230 SAL A^ * | |
231 SAL AH(AEIOUY)- H | |
232 SAL AR(AEIOUY)- R | |
233 SAL A(HR) _ | |
234 SAL À^ * | |
235 SAL Å^ * | |
236 SAL BB- _ | |
237 SAL B B | |
238 SAL CQ- _ | |
239 SAL CIA X | |
240 SAL CH X | |
241 SAL C(EIY)- S | |
242 SAL CK K | |
243 SAL COUGH^ KF | |
244 SAL CC< C | |
245 SAL C K | |
246 SAL DG(EIY) K | |
247 SAL DD- _ | |
248 SAL D T | |
249 SAL É< E | |
250 SAL EH(AEIOUY)-^ *H | |
251 SAL ER(AEIOUY)-^ *R | |
252 SAL E(HR)^ * | |
253 SAL ENOUGH^$ *NF | |
254 SAL E^ * | |
255 SAL EH(AEIOUY)- H | |
256 SAL ER(AEIOUY)- R | |
257 SAL E(HR) _ | |
258 SAL FF- _ | |
259 SAL F F | |
260 SAL GN^ N | |
261 SAL GN$ N | |
262 SAL GNS$ NS | |
263 SAL GNED$ N | |
264 SAL GH(AEIOUY)- K | |
265 SAL GH _ | |
266 SAL GG9 K | |
267 SAL G K | |
268 SAL H H | |
269 SAL IH(AEIOUY)-^ *H | |
270 SAL IR(AEIOUY)-^ *R | |
271 SAL I(HR)^ * | |
272 SAL I^ * | |
273 SAL ING6 N | |
274 SAL IH(AEIOUY)- H | |
275 SAL IR(AEIOUY)- R | |
276 SAL I(HR) _ | |
277 SAL J K | |
278 SAL KN^ N | |
279 SAL KK- _ | |
280 SAL K K | |
281 SAL LAUGH^ LF | |
282 SAL LL- _ | |
283 SAL L L | |
284 SAL MB$ M | |
285 SAL MM M | |
286 SAL M M | |
287 SAL NN- _ | |
288 SAL N N | |
289 SAL OH(AEIOUY)-^ *H | |
290 SAL OR(AEIOUY)-^ *R | |
291 SAL O(HR)^ * | |
292 SAL O^ * | |
293 SAL OH(AEIOUY)- H | |
294 SAL OR(AEIOUY)- R | |
295 SAL O(HR) _ | |
296 SAL PH F | |
297 SAL PN^ N | |
298 SAL PP- _ | |
299 SAL P P | |
300 SAL Q K | |
301 SAL RH^ R | |
302 SAL ROUGH^ RF | |
303 SAL RR- _ | |
304 SAL R R | |
305 SAL SCH(EOU)- SK | |
306 SAL SC(IEY)- S | |
307 SAL SH X | |
308 SAL SI(AO)- X | |
309 SAL SS- _ | |
310 SAL S S | |
311 SAL TI(AO)- X | |
312 SAL TH @ | |
313 SAL TCH-- _ | |
314 SAL TOUGH^ TF | |
315 SAL TT- _ | |
316 SAL T T | |
317 SAL UH(AEIOUY)-^ *H | |
318 SAL UR(AEIOUY)-^ *R | |
319 SAL U(HR)^ * | |
320 SAL U^ * | |
321 SAL UH(AEIOUY)- H | |
322 SAL UR(AEIOUY)- R | |
323 SAL U(HR) _ | |
324 SAL V^ W | |
325 SAL V F | |
326 SAL WR^ R | |
327 SAL WH^ W | |
328 SAL W(AEIOU)- W | |
329 SAL X^ S | |
330 SAL X KS | |
331 SAL Y(AEIOU)- Y | |
332 SAL ZZ- _ | |
333 SAL Z S | |
500 | 334 affend_sal |
389 | 335 |
500 | 336 2affstart |
391 | 337 SET ISO8859-1 |
338 | |
339 FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ | |
340 LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ | |
341 UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ | |
342 | |
343 PFXPOSTPONE | |
344 | |
345 MIDWORD '- | |
346 | |
347 KEP = | |
348 RAR ? | |
349 BAD ! | |
350 | |
351 PFX I N 1 | |
352 PFX I 0 in . | |
353 | |
354 PFX O Y 1 | |
456 | 355 PFX O 0 out [a-z] |
391 | 356 |
357 SFX S Y 2 | |
358 SFX S 0 s [^s] | |
359 SFX S 0 es s | |
360 | |
361 SFX N N 3 | |
362 SFX N 0 en [^n] | |
363 SFX N 0 nen n | |
364 SFX N 0 n . | |
365 | |
366 REP 3 | |
367 REP g ch | |
368 REP ch g | |
369 REP svp s.v.p. | |
370 | |
371 MAP 9 | |
372 MAP aàáâãäå | |
373 MAP eèéêë | |
374 MAP iìíîï | |
375 MAP oòóôõö | |
376 MAP uùúûü | |
377 MAP nñ | |
378 MAP cç | |
379 MAP yÿý | |
380 MAP sß | |
500 | 381 2affend |
382 | |
383 2good: puts | |
384 bad: inputs comment ok Ok end the. test déôl | |
385 badend | |
386 | |
387 addstart | |
388 /regions=usgbnz | |
389 elequint/2 | |
390 elekwint/3 | |
391 addend | |
392 | |
393 test2: | |
394 elequint test elekwint test elekwent asdf | |
395 | |
396 Test rules for compounding. | |
397 | |
398 3affstart | |
399 SET ISO8859-1 | |
391 | 400 |
500 | 401 COMPOUNDMIN 3 |
714 | 402 COMPOUNDRULE m* |
500 | 403 NEEDCOMPOUND x |
404 3affend | |
389 | 405 |
500 | 406 3dicstart |
407 1234 | |
408 foo/m | |
409 bar/mx | |
410 mï/m | |
411 la/mx | |
412 3dicend | |
413 | |
414 3good: foo mï foobar foofoobar barfoo barbarfoo | |
415 bad: bar la foomï barmï mïfoo mïbar mïmï lala mïla lamï foola labar | |
416 badend | |
417 | |
418 | |
419 Tests for compounding. | |
420 | |
421 4affstart | |
489 | 422 SET ISO8859-1 |
423 | |
424 FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ | |
425 LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ | |
426 UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ | |
427 | |
714 | 428 COMPOUNDRULE m+ |
429 COMPOUNDRULE sm*e | |
430 COMPOUNDRULE sm+ | |
489 | 431 COMPOUNDMIN 3 |
809 | 432 COMPOUNDWORDMAX 3 |
433 COMPOUNDFORBIDFLAG t | |
489 | 434 |
435 COMPOUNDSYLMAX 5 | |
436 SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui | |
437 | |
438 MAP 9 | |
439 MAP aàáâãäå | |
440 MAP eèéêë | |
441 MAP iìíîï | |
442 MAP oòóôõö | |
443 MAP uùúûü | |
444 MAP nñ | |
445 MAP cç | |
446 MAP yÿý | |
447 MAP sß | |
448 | |
449 NEEDAFFIX x | |
450 | |
451 PFXPOSTPONE | |
452 | |
453 MIDWORD '- | |
454 | |
455 SFX q N 1 | |
456 SFX q 0 -ok . | |
457 | |
458 SFX a Y 2 | |
459 SFX a 0 s . | |
809 | 460 SFX a 0 ize/t . |
489 | 461 |
462 PFX p N 1 | |
463 PFX p 0 pre . | |
819 | 464 |
465 PFX P N 1 | |
466 PFX P 0 nou . | |
500 | 467 4affend |
489 | 468 |
500 | 469 4dicstart |
489 | 470 1234 |
819 | 471 word/mP |
489 | 472 util/am |
473 pro/xq | |
474 tomato/m | |
475 bork/mp | |
476 start/s | |
477 end/e | |
500 | 478 4dicend |
389 | 479 |
500 | 480 4good: word util bork prebork start end wordutil wordutils pro-ok |
481 bork borkbork borkborkbork borkborkborkbork borkborkborkborkbork | |
482 tomato tomatotomato startend startword startwordword startwordend | |
819 | 483 startwordwordend startwordwordwordend prebork preborkbork |
484 preborkborkbork | |
485 nouword | |
500 | 486 bad: wordutilize pro borkborkborkborkborkbork tomatotomatotomato |
487 endstart endend startstart wordend wordstart | |
819 | 488 preborkprebork preborkpreborkbork |
500 | 489 startwordwordwordwordend borkpreborkpreborkbork |
819 | 490 utilsbork startnouword |
500 | 491 badend |
389 | 492 |
501 | 493 Test affix flags with two characters |
494 | |
495 5affstart | |
496 SET ISO8859-1 | |
497 | |
498 FLAG long | |
499 | |
500 NEEDAFFIX !! | |
501 | |
714 | 502 COMPOUNDRULE ssmm*ee |
501 | 503 |
504 NEEDCOMPOUND xx | |
819 | 505 COMPOUNDPERMITFLAG pp |
501 | 506 |
507 SFX 13 Y 1 | |
508 SFX 13 0 bork . | |
509 | |
510 SFX a1 Y 1 | |
511 SFX a1 0 a1 . | |
512 | |
513 SFX aé Y 1 | |
514 SFX aé 0 aé . | |
515 | |
516 PFX zz Y 1 | |
819 | 517 PFX zz 0 pre/pp . |
518 | |
519 PFX yy Y 1 | |
520 PFX yy 0 nou . | |
501 | 521 5affend |
522 | |
523 5dicstart | |
524 1234 | |
525 foo/a1aé!! | |
526 bar/zz13ee | |
527 start/ss | |
819 | 528 end/eeyy |
501 | 529 middle/mmxx |
530 5dicend | |
531 | |
532 5good: fooa1 fooaé bar prebar barbork prebarbork startprebar | |
819 | 533 start end startend startmiddleend nouend |
501 | 534 bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart |
819 | 535 startprobar startnouend |
501 | 536 badend |
537 | |
538 6affstart | |
539 SET ISO8859-1 | |
540 | |
541 FLAG caplong | |
542 | |
543 NEEDAFFIX A! | |
544 | |
714 | 545 COMPOUNDRULE sMm*Ee |
501 | 546 |
547 NEEDCOMPOUND Xx | |
548 | |
819 | 549 COMPOUNDPERMITFLAG p |
550 | |
501 | 551 SFX N3 Y 1 |
552 SFX N3 0 bork . | |
553 | |
554 SFX A1 Y 1 | |
555 SFX A1 0 a1 . | |
556 | |
557 SFX Aé Y 1 | |
558 SFX Aé 0 aé . | |
559 | |
560 PFX Zz Y 1 | |
819 | 561 PFX Zz 0 pre/p . |
501 | 562 6affend |
563 | |
564 6dicstart | |
565 1234 | |
566 mee/A1AéA! | |
567 bar/ZzN3Ee | |
568 lead/s | |
569 end/Ee | |
570 middle/MmXx | |
571 6dicend | |
572 | |
573 6good: meea1 meeaé bar prebar barbork prebarbork leadprebar | |
574 lead end leadend leadmiddleend | |
575 bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead | |
576 leadprobar | |
577 badend | |
578 | |
579 7affstart | |
580 SET ISO8859-1 | |
581 | |
582 FLAG num | |
583 | |
584 NEEDAFFIX 9999 | |
585 | |
714 | 586 COMPOUNDRULE 2,77*123 |
501 | 587 |
588 NEEDCOMPOUND 1 | |
819 | 589 COMPOUNDPERMITFLAG 432 |
501 | 590 |
591 SFX 61003 Y 1 | |
592 SFX 61003 0 meat . | |
593 | |
594 SFX 391 Y 1 | |
595 SFX 391 0 a1 . | |
596 | |
597 SFX 111 Y 1 | |
598 SFX 111 0 aé . | |
599 | |
600 PFX 17 Y 1 | |
819 | 601 PFX 17 0 pre/432 . |
501 | 602 7affend |
603 | |
604 7dicstart | |
605 1234 | |
606 mee/391,111,9999 | |
607 bar/17,61003,123 | |
608 lead/2 | |
609 tail/123 | |
610 middle/77,1 | |
611 7dicend | |
612 | |
613 7good: meea1 meeaé bar prebar barmeat prebarmeat leadprebar | |
614 lead tail leadtail leadmiddletail | |
615 bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead | |
616 leadprobar | |
617 badend | |
618 | |
704 | 619 Test NOSLITSUGS |
620 | |
621 8affstart | |
622 SET ISO8859-1 | |
623 | |
624 NOSPLITSUGS | |
625 8affend | |
626 | |
627 8dicstart | |
628 1234 | |
629 foo | |
630 bar | |
631 faabar | |
632 8dicend | |
633 | |
634 8good: foo bar faabar | |
635 bad: foobar barfoo | |
636 badend | |
637 | |
638 | |
389 | 639 test output: |