From 0a495d0be812eddb5af2c7419f228116399a5aba Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Wed, 15 Jul 2015 09:34:39 +0200 Subject: tests: Migrate legacy test 59. --- .../legacy/059_utf8_spell_checking_spec.lua | 908 +++++++++++++++++++++ 1 file changed, 908 insertions(+) create mode 100644 test/functional/legacy/059_utf8_spell_checking_spec.lua diff --git a/test/functional/legacy/059_utf8_spell_checking_spec.lua b/test/functional/legacy/059_utf8_spell_checking_spec.lua new file mode 100644 index 0000000000..d5dadc6b02 --- /dev/null +++ b/test/functional/legacy/059_utf8_spell_checking_spec.lua @@ -0,0 +1,908 @@ +-- Tests for spell checking with 'encoding' set to "utf-8". + +local helpers = require('test.functional.helpers') +local feed, insert, source = helpers.feed, helpers.insert, helpers.source +local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect + +describe("spell checking with 'encoding' set to utf-8", function() + setup(clear) + + it('is working', function() + insert([=[ + 1affstart + SET ISO8859-1 + TRY esianrtolcdugmphbyfvkwjkqxz-'ESIANRTOLCDUGMPHBYFVKWJKQXZ + + FOL + LOW + UPP + + SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ޿ + SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep? + + MIDWORD '- + + KEP = + RAR ? + BAD ! + + #NOSPLITSUGS + + PFX I N 1 + PFX I 0 in . + + PFX O Y 1 + PFX O 0 out . + + SFX S Y 2 + SFX S 0 s [^s] + SFX S 0 es s + + SFX N N 3 + SFX N 0 en [^n] + SFX N 0 nen n + SFX N 0 n . + + REP 3 + REP g ch + REP ch g + REP svp s.v.p. + + MAP 9 + MAP a + MAP e + MAP i + MAP o + MAP u + MAP n + MAP c + MAP y + MAP s + 1affend + + affstart_sal + SET ISO8859-1 + TRY esianrtolcdugmphbyfvkwjkqxz-'ESIANRTOLCDUGMPHBYFVKWJKQXZ + + FOL + LOW + UPP + + MIDWORD '- + + KEP = + RAR ? + BAD ! + + #NOSPLITSUGS + + PFX I N 1 + PFX I 0 in . + + PFX O Y 1 + PFX O 0 out . + + SFX S Y 2 + SFX S 0 s [^s] + SFX S 0 es s + + SFX N N 3 + SFX N 0 en [^n] + SFX N 0 nen n + SFX N 0 n . + + REP 3 + REP g ch + REP ch g + REP svp s.v.p. + + MAP 9 + MAP a + MAP e + MAP i + MAP o + MAP u + MAP n + MAP c + MAP y + MAP s + + SAL AH(AEIOUY)-^ *H + SAL AR(AEIOUY)-^ *R + SAL A(HR)^ * + SAL A^ * + SAL AH(AEIOUY)- H + SAL AR(AEIOUY)- R + SAL A(HR) _ + SAL ^ * + SAL ^ * + SAL BB- _ + SAL B B + SAL CQ- _ + SAL CIA X + SAL CH X + SAL C(EIY)- S + SAL CK K + SAL COUGH^ KF + SAL CC< C + SAL C K + SAL DG(EIY) K + SAL DD- _ + SAL D T + SAL < E + SAL EH(AEIOUY)-^ *H + SAL ER(AEIOUY)-^ *R + SAL E(HR)^ * + SAL ENOUGH^$ *NF + SAL E^ * + SAL EH(AEIOUY)- H + SAL ER(AEIOUY)- R + SAL E(HR) _ + SAL FF- _ + SAL F F + SAL GN^ N + SAL GN$ N + SAL GNS$ NS + SAL GNED$ N + SAL GH(AEIOUY)- K + SAL GH _ + SAL GG9 K + SAL G K + SAL H H + SAL IH(AEIOUY)-^ *H + SAL IR(AEIOUY)-^ *R + SAL I(HR)^ * + SAL I^ * + SAL ING6 N + SAL IH(AEIOUY)- H + SAL IR(AEIOUY)- R + SAL I(HR) _ + SAL J K + SAL KN^ N + SAL KK- _ + SAL K K + SAL LAUGH^ LF + SAL LL- _ + SAL L L + SAL MB$ M + SAL MM M + SAL M M + SAL NN- _ + SAL N N + SAL OH(AEIOUY)-^ *H + SAL OR(AEIOUY)-^ *R + SAL O(HR)^ * + SAL O^ * + SAL OH(AEIOUY)- H + SAL OR(AEIOUY)- R + SAL O(HR) _ + SAL PH F + SAL PN^ N + SAL PP- _ + SAL P P + SAL Q K + SAL RH^ R + SAL ROUGH^ RF + SAL RR- _ + SAL R R + SAL SCH(EOU)- SK + SAL SC(IEY)- S + SAL SH X + SAL SI(AO)- X + SAL SS- _ + SAL S S + SAL TI(AO)- X + SAL TH @ + SAL TCH-- _ + SAL TOUGH^ TF + SAL TT- _ + SAL T T + SAL UH(AEIOUY)-^ *H + SAL UR(AEIOUY)-^ *R + SAL U(HR)^ * + SAL U^ * + SAL UH(AEIOUY)- H + SAL UR(AEIOUY)- R + SAL U(HR) _ + SAL V^ W + SAL V F + SAL WR^ R + SAL WH^ W + SAL W(AEIOU)- W + SAL X^ S + SAL X KS + SAL Y(AEIOU)- Y + SAL ZZ- _ + SAL Z S + affend_sal + + 2affstart + SET ISO8859-1 + + FOL + LOW + UPP + + PFXPOSTPONE + + MIDWORD '- + + KEP = + RAR ? + BAD ! + + #NOSPLITSUGS + + PFX I N 1 + PFX I 0 in . + + PFX O Y 1 + PFX O 0 out [a-z] + + SFX S Y 2 + SFX S 0 s [^s] + SFX S 0 es s + + SFX N N 3 + SFX N 0 en [^n] + SFX N 0 nen n + SFX N 0 n . + + REP 3 + REP g ch + REP ch g + REP svp s.v.p. + + MAP 9 + MAP a + MAP e + MAP i + MAP o + MAP u + MAP n + MAP c + MAP y + MAP s + 2affend + + 1dicstart + 123456 + test/NO + # comment + wrong + Comment + OK + uk + put/ISO + the end + deol + dr + 1dicend + + addstart + /regions=usgbnz + elequint/2 + elekwint/3 + addend + + 1good: wrong OK puts. Test the end + bad: inputs comment ok Ok. test déôl end the + badend + + 2good: puts + bad: inputs comment ok Ok end the. test déôl + badend + + Test rules for compounding. + + 3affstart + SET ISO8859-1 + + COMPOUNDMIN 3 + COMPOUNDRULE m* + NEEDCOMPOUND x + 3affend + + 3dicstart + 1234 + foo/m + bar/mx + m/m + la/mx + 3dicend + + 3good: foo mï foobar foofoobar barfoo barbarfoo + bad: bar la foomï barmï mïfoo mïbar mïmï lala mïla lamï foola labar + badend + + + Tests for compounding. + + 4affstart + SET ISO8859-1 + + FOL + LOW + UPP + + COMPOUNDRULE m+ + COMPOUNDRULE sm*e + COMPOUNDRULE sm+ + COMPOUNDMIN 3 + COMPOUNDWORDMAX 3 + COMPOUNDFORBIDFLAG t + + COMPOUNDSYLMAX 5 + SYLLABLE aeiouy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui + + MAP 9 + MAP a + MAP e + MAP i + MAP o + MAP u + MAP n + MAP c + MAP y + MAP s + + NEEDAFFIX x + + PFXPOSTPONE + + MIDWORD '- + + SFX q N 1 + SFX q 0 -ok . + + SFX a Y 2 + SFX a 0 s . + SFX a 0 ize/t . + + PFX p N 1 + PFX p 0 pre . + + PFX P N 1 + PFX P 0 nou . + 4affend + + 4dicstart + 1234 + word/mP + util/am + pro/xq + tomato/m + bork/mp + start/s + end/e + 4dicend + + 4good: word util bork prebork start end wordutil wordutils pro-ok + bork borkbork borkborkbork borkborkborkbork borkborkborkborkbork + tomato tomatotomato startend startword startwordword startwordend + startwordwordend startwordwordwordend prebork preborkbork + preborkborkbork + nouword + bad: wordutilize pro borkborkborkborkborkbork tomatotomatotomato + endstart endend startstart wordend wordstart + preborkprebork preborkpreborkbork + startwordwordwordwordend borkpreborkpreborkbork + utilsbork startnouword + badend + + test2: + elequint test elekwint test elekwent asdf + + Test affix flags with two characters + + 5affstart + SET ISO8859-1 + + FLAG long + + NEEDAFFIX !! + + COMPOUNDRULE ssmm*ee + + NEEDCOMPOUND xx + COMPOUNDPERMITFLAG pp + + SFX 13 Y 1 + SFX 13 0 bork . + + SFX a1 Y 1 + SFX a1 0 a1 . + + SFX a Y 1 + SFX a 0 a . + + PFX zz Y 1 + PFX zz 0 pre/pp . + + PFX yy Y 1 + PFX yy 0 nou . + 5affend + + 5dicstart + 1234 + foo/a1a!! + bar/zz13ee + start/ss + end/eeyy + middle/mmxx + 5dicend + + 5good: fooa1 fooaé bar prebar barbork prebarbork startprebar + start end startend startmiddleend nouend + bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart + startprobar startnouend + badend + + 6affstart + SET ISO8859-1 + + FLAG caplong + + NEEDAFFIX A! + + COMPOUNDRULE sMm*Ee + + NEEDCOMPOUND Xx + + COMPOUNDPERMITFLAG p + + SFX N3 Y 1 + SFX N3 0 bork . + + SFX A1 Y 1 + SFX A1 0 a1 . + + SFX A Y 1 + SFX A 0 a . + + PFX Zz Y 1 + PFX Zz 0 pre/p . + 6affend + + 6dicstart + 1234 + mee/A1AA! + bar/ZzN3Ee + lead/s + end/Ee + middle/MmXx + 6dicend + + 6good: meea1 meeaé bar prebar barbork prebarbork leadprebar + lead end leadend leadmiddleend + bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead + leadprobar + badend + + 7affstart + SET ISO8859-1 + + FOL + LOW + UPP + + FLAG num + + NEEDAFFIX 9999 + + COMPOUNDRULE 2,77*123 + + NEEDCOMPOUND 1 + COMPOUNDPERMITFLAG 432 + + SFX 61003 Y 1 + SFX 61003 0 meat . + + SFX 391 Y 1 + SFX 391 0 a1 . + + SFX 111 Y 1 + SFX 111 0 a . + + PFX 17 Y 1 + PFX 17 0 pre/432 . + 7affend + + 7dicstart + 1234 + mee/391,111,9999 + bar/17,61003,123 + lead/2 + tail/123 + middle/77,1 + 7dicend + + 7good: meea1 meeaé bar prebar barmeat prebarmeat leadprebar + lead tail leadtail leadmiddletail + bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead + leadprobar + badend + + test output:]=]) + + execute('so small.vim') + execute('so mbyte.vim') + + -- Don't want to depend on the locale from the environment. The .aff and .dic. + -- Text is in latin1, the test text is utf-8. + execute('set enc=latin1') + execute('e!') + execute('set enc=utf-8') + execute('set fenc=') + + -- Function to test .aff/.dic with list of good and bad words. + execute('func TestOne(aff, dic)') + feed(' set spellfile=') + feed([[ $put ='']]) + feed([[ $put ='test '. a:aff . '-' . a:dic]]) + -- Generate a .spl file from a .dic and .aff file. + feed([[ exe '1;/^' . a:aff . 'affstart/+1,/^' . a:aff . 'affend/-1w! Xtest.aff']]) + feed([[ exe '1;/^' . a:dic . 'dicstart/+1,/^' . a:dic . 'dicend/-1w! Xtest.dic']]) + feed(' mkspell! Xtest Xtest') + -- Use that spell file. + feed(' set spl=Xtest.utf-8.spl spell') + -- List all valid words. + feed(' spelldump') + feed(' %yank') + feed(' quit') + feed(' $put') + feed([[ $put ='-------']]) + -- Find all bad words and suggestions for them. + feed([[ exe '1;/^' . a:aff . 'good:']]) + feed(' normal 0f:]s') + feed([[ let prevbad = '']]) + feed(' while 1') + feed(' let [bad, a] = spellbadword()') + feed([[ if bad == '' || bad == prevbad || bad == 'badend']]) + feed(' break') + feed(' endif') + feed(' let prevbad = bad') + feed(' let lst = spellsuggest(bad, 3)') + feed(' normal mm') + feed(' $put =bad') + feed(' $put =string(lst)') + feed(' normal `m]s') + feed(' endwhile') + feed('endfunc') + + execute([[call TestOne('1', '1')]]) + execute([[$put =soundfold('goobledygoook')]]) + execute([[$put =soundfold('kóopërÿnôven')]]) + execute([[$put =soundfold('oeverloos gezwets edale')]]) + + + -- And now with SAL instead of SOFO items; test automatic reloading. + feed('gg:/^affstart_sal/+1,/^affend_sal/-1w! Xtest.aff') + execute('mkspell! Xtest Xtest') + execute([[$put =soundfold('goobledygoook')]]) + execute([[$put =soundfold('kóopërÿnôven')]]) + execute([[$put =soundfold('oeverloos gezwets edale')]]) + + -- Also use an addition file. + feed('gg:/^addstart/+1,/^addend/-1w! Xtest.utf-8.add') + execute('mkspell! Xtest.utf-8.add.spl Xtest.utf-8.add') + execute('set spellfile=Xtest.utf-8.add') + execute('/^test2:') + feed(']s:let [str, a] = spellbadword()') + execute('$put =str') + execute('set spl=Xtest_us.utf-8.spl') + execute('/^test2:') + feed(']smm:let [str, a] = spellbadword()') + execute('$put =str') + feed('`m]s:let [str, a] = spellbadword()') + execute('$put =str') + execute('set spl=Xtest_gb.utf-8.spl') + execute('/^test2:') + feed(']smm:let [str, a] = spellbadword()') + execute('$put =str') + feed('`m]s:let [str, a] = spellbadword()') + execute('$put =str') + execute('set spl=Xtest_nz.utf-8.spl') + execute('/^test2:') + feed(']smm:let [str, a] = spellbadword()') + execute('$put =str') + feed('`m]s:let [str, a] = spellbadword()') + execute('$put =str') + execute('set spl=Xtest_ca.utf-8.spl') + execute('/^test2:') + feed(']smm:let [str, a] = spellbadword()') + execute('$put =str') + feed('`m]s:let [str, a] = spellbadword()') + execute('$put =str') + execute('unlet str a') + + -- Postponed prefixes. + execute([[call TestOne('2', '1')]]) + + -- Compound words. + execute([[call TestOne('3', '3')]]) + execute([[call TestOne('4', '4')]]) + execute([[call TestOne('5', '5')]]) + execute([[call TestOne('6', '6')]]) + execute([[call TestOne('7', '7')]]) + + -- Clean up for valgrind. + execute('delfunc TestOne') + execute('set spl= enc=latin1') + + feed('gg:/^test output:/,$wq! test.out') + + -- Assert buffer contents. + expect([=[ + test output: + + test 1-1 + # file: Xtest.utf-8.spl + Comment + deol + déôr + input + OK + output + outputs + outtest + put + puts + test + testen + testn + the end + uk + wrong + ------- + bad + ['put', 'uk', 'OK'] + inputs + ['input', 'puts', 'outputs'] + comment + ['Comment', 'outtest', 'the end'] + ok + ['OK', 'uk', 'put'] + Ok + ['OK', 'Uk', 'Put'] + test + ['Test', 'testn', 'testen'] + déôl + ['deol', 'déôr', 'test'] + end + ['put', 'uk', 'test'] + the + ['put', 'uk', 'test'] + gebletegek + kepereneven + everles gesvets etele + kbltykk + kprnfn + *fls kswts tl + elekwent + elequint + elekwint + elekwint + elekwent + elequint + elekwent + elequint + elekwint + + test 2-1 + # file: Xtest.utf-8.spl + Comment + deol + déôr + OK + put + input + output + puts + outputs + test + outtest + testen + testn + the end + uk + wrong + ------- + bad + ['put', 'uk', 'OK'] + inputs + ['input', 'puts', 'outputs'] + comment + ['Comment'] + ok + ['OK', 'uk', 'put'] + Ok + ['OK', 'Uk', 'Put'] + end + ['put', 'uk', 'deol'] + the + ['put', 'uk', 'test'] + test + ['Test', 'testn', 'testen'] + déôl + ['deol', 'déôr', 'test'] + + test 3-3 + # file: Xtest.utf-8.spl + foo + mï + ------- + bad + ['foo', 'mï'] + bar + ['barfoo', 'foobar', 'foo'] + la + ['mï', 'foo'] + foomï + ['foo mï', 'foo', 'foofoo'] + barmï + ['barfoo', 'mï', 'barbar'] + mïfoo + ['mï foo', 'foo', 'foofoo'] + mïbar + ['foobar', 'barbar', 'mï'] + mïmï + ['mï mï', 'mï'] + lala + [] + mïla + ['mï', 'mï mï'] + lamï + ['mï', 'mï mï'] + foola + ['foo', 'foobar', 'foofoo'] + labar + ['barbar', 'foobar'] + + test 4-4 + # file: Xtest.utf-8.spl + bork + prebork + end + pro-ok + start + tomato + util + utilize + utils + word + nouword + ------- + bad + ['end', 'bork', 'word'] + wordutilize + ['word utilize', 'wordutils', 'wordutil'] + pro + ['bork', 'word', 'end'] + borkborkborkborkborkbork + ['bork borkborkborkborkbork', 'borkbork borkborkborkbork', 'borkborkbork borkborkbork'] + tomatotomatotomato + ['tomato tomatotomato', 'tomatotomato tomato', 'tomato tomato tomato'] + endstart + ['end start', 'start'] + endend + ['end end', 'end'] + startstart + ['start start'] + wordend + ['word end', 'word', 'wordword'] + wordstart + ['word start', 'bork start'] + preborkprebork + ['prebork prebork', 'preborkbork', 'preborkborkbork'] + preborkpreborkbork + ['prebork preborkbork', 'preborkborkbork', 'preborkborkborkbork'] + startwordwordwordwordend + ['startwordwordwordword end', 'startwordwordwordword', 'start wordwordwordword end'] + borkpreborkpreborkbork + ['bork preborkpreborkbork', 'bork prebork preborkbork', 'bork preborkprebork bork'] + utilsbork + ['utilbork', 'utils bork', 'util bork'] + startnouword + ['start nouword', 'startword', 'startborkword'] + + test 5-5 + # file: Xtest.utf-8.spl + bar + barbork + end + fooa1 + fooaé + nouend + prebar + prebarbork + start + ------- + bad + ['bar', 'end', 'fooa1'] + foo + ['fooa1', 'fooaé', 'bar'] + fooa2 + ['fooa1', 'fooaé', 'bar'] + prabar + ['prebar', 'bar', 'bar bar'] + probarbirk + ['prebarbork'] + middle + [] + startmiddle + ['startmiddleend', 'startmiddlebar'] + middleend + [] + endstart + ['end start', 'start'] + startprobar + ['startprebar', 'start prebar', 'startbar'] + startnouend + ['start nouend', 'startend'] + + test 6-6 + # file: Xtest.utf-8.spl + bar + barbork + end + lead + meea1 + meeaé + prebar + prebarbork + ------- + bad + ['bar', 'end', 'lead'] + mee + ['meea1', 'meeaé', 'bar'] + meea2 + ['meea1', 'meeaé', 'lead'] + prabar + ['prebar', 'bar', 'leadbar'] + probarbirk + ['prebarbork'] + middle + [] + leadmiddle + ['leadmiddleend', 'leadmiddlebar'] + middleend + [] + endlead + ['end lead', 'lead', 'end end'] + leadprobar + ['leadprebar', 'lead prebar', 'leadbar'] + + test 7-7 + # file: Xtest.utf-8.spl + bar + barmeat + lead + meea1 + meeaé + prebar + prebarmeat + tail + ------- + bad + ['bar', 'lead', 'tail'] + mee + ['meea1', 'meeaé', 'bar'] + meea2 + ['meea1', 'meeaé', 'lead'] + prabar + ['prebar', 'bar', 'leadbar'] + probarmaat + ['prebarmeat'] + middle + [] + leadmiddle + ['leadmiddlebar'] + middletail + [] + taillead + ['tail lead', 'tail'] + leadprobar + ['leadprebar', 'lead prebar', 'leadbar']]=]) + end) +end) -- cgit From e60e46596ae32e17b4bb3733b7880344f1f7f767 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Wed, 15 Jul 2015 09:41:38 +0200 Subject: test59: Inital clean up. Fix some feed() calls and string delimiters Fix trimming of buffer before final expect(). --- .../legacy/059_utf8_spell_checking_spec.lua | 42 +++++++++++++--------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/test/functional/legacy/059_utf8_spell_checking_spec.lua b/test/functional/legacy/059_utf8_spell_checking_spec.lua index d5dadc6b02..c5af30b9b5 100644 --- a/test/functional/legacy/059_utf8_spell_checking_spec.lua +++ b/test/functional/legacy/059_utf8_spell_checking_spec.lua @@ -8,7 +8,7 @@ describe("spell checking with 'encoding' set to utf-8", function() setup(clear) it('is working', function() - insert([=[ + insert([[ 1affstart SET ISO8859-1 TRY esianrtolcdugmphbyfvkwjkqxz-'ESIANRTOLCDUGMPHBYFVKWJKQXZ @@ -523,10 +523,7 @@ describe("spell checking with 'encoding' set to utf-8", function() leadprobar badend - test output:]=]) - - execute('so small.vim') - execute('so mbyte.vim') + test output:]]) -- Don't want to depend on the locale from the environment. The .aff and .dic. -- Text is in latin1, the test text is utf-8. @@ -577,42 +574,53 @@ describe("spell checking with 'encoding' set to utf-8", function() -- And now with SAL instead of SOFO items; test automatic reloading. - feed('gg:/^affstart_sal/+1,/^affend_sal/-1w! Xtest.aff') + feed('gg') + execute(':/^affstart_sal/+1,/^affend_sal/-1w! Xtest.aff') execute('mkspell! Xtest Xtest') execute([[$put =soundfold('goobledygoook')]]) execute([[$put =soundfold('kóopërÿnôven')]]) execute([[$put =soundfold('oeverloos gezwets edale')]]) -- Also use an addition file. - feed('gg:/^addstart/+1,/^addend/-1w! Xtest.utf-8.add') + feed('gg') + execute(':/^addstart/+1,/^addend/-1w! Xtest.utf-8.add') execute('mkspell! Xtest.utf-8.add.spl Xtest.utf-8.add') execute('set spellfile=Xtest.utf-8.add') execute('/^test2:') - feed(']s:let [str, a] = spellbadword()') + feed(']s') + execute('let [str, a] = spellbadword()') execute('$put =str') execute('set spl=Xtest_us.utf-8.spl') execute('/^test2:') - feed(']smm:let [str, a] = spellbadword()') + feed(']smm') + execute('let [str, a] = spellbadword()') execute('$put =str') - feed('`m]s:let [str, a] = spellbadword()') + feed('`m]s') + execute('let [str, a] = spellbadword()') execute('$put =str') execute('set spl=Xtest_gb.utf-8.spl') execute('/^test2:') - feed(']smm:let [str, a] = spellbadword()') + feed(']smm') + execute('let [str, a] = spellbadword()') execute('$put =str') - feed('`m]s:let [str, a] = spellbadword()') + feed('`m]s') + execute('let [str, a] = spellbadword()') execute('$put =str') execute('set spl=Xtest_nz.utf-8.spl') execute('/^test2:') - feed(']smm:let [str, a] = spellbadword()') + feed(']smm') + execute('let [str, a] = spellbadword()') execute('$put =str') - feed('`m]s:let [str, a] = spellbadword()') + feed('`m]s') + execute('let [str, a] = spellbadword()') execute('$put =str') execute('set spl=Xtest_ca.utf-8.spl') execute('/^test2:') - feed(']smm:let [str, a] = spellbadword()') + feed(']smm') + execute('let [str, a] = spellbadword()') execute('$put =str') - feed('`m]s:let [str, a] = spellbadword()') + feed('`m]s') + execute('let [str, a] = spellbadword()') execute('$put =str') execute('unlet str a') @@ -630,7 +638,7 @@ describe("spell checking with 'encoding' set to utf-8", function() execute('delfunc TestOne') execute('set spl= enc=latin1') - feed('gg:/^test output:/,$wq! test.out') + execute('0,/^test output:/-1 delete') -- Assert buffer contents. expect([=[ -- cgit From 144b4954f7bf4dbb5cc8f16f0f2a6537778d2eb5 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Wed, 15 Jul 2015 09:42:00 +0200 Subject: test59: Turn function definition into source() call. --- .../legacy/059_utf8_spell_checking_spec.lua | 68 +++++++++++----------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/test/functional/legacy/059_utf8_spell_checking_spec.lua b/test/functional/legacy/059_utf8_spell_checking_spec.lua index c5af30b9b5..817d9ad5b4 100644 --- a/test/functional/legacy/059_utf8_spell_checking_spec.lua +++ b/test/functional/legacy/059_utf8_spell_checking_spec.lua @@ -533,39 +533,41 @@ describe("spell checking with 'encoding' set to utf-8", function() execute('set fenc=') -- Function to test .aff/.dic with list of good and bad words. - execute('func TestOne(aff, dic)') - feed(' set spellfile=') - feed([[ $put ='']]) - feed([[ $put ='test '. a:aff . '-' . a:dic]]) - -- Generate a .spl file from a .dic and .aff file. - feed([[ exe '1;/^' . a:aff . 'affstart/+1,/^' . a:aff . 'affend/-1w! Xtest.aff']]) - feed([[ exe '1;/^' . a:dic . 'dicstart/+1,/^' . a:dic . 'dicend/-1w! Xtest.dic']]) - feed(' mkspell! Xtest Xtest') - -- Use that spell file. - feed(' set spl=Xtest.utf-8.spl spell') - -- List all valid words. - feed(' spelldump') - feed(' %yank') - feed(' quit') - feed(' $put') - feed([[ $put ='-------']]) - -- Find all bad words and suggestions for them. - feed([[ exe '1;/^' . a:aff . 'good:']]) - feed(' normal 0f:]s') - feed([[ let prevbad = '']]) - feed(' while 1') - feed(' let [bad, a] = spellbadword()') - feed([[ if bad == '' || bad == prevbad || bad == 'badend']]) - feed(' break') - feed(' endif') - feed(' let prevbad = bad') - feed(' let lst = spellsuggest(bad, 3)') - feed(' normal mm') - feed(' $put =bad') - feed(' $put =string(lst)') - feed(' normal `m]s') - feed(' endwhile') - feed('endfunc') + source([[ + func TestOne(aff, dic) + set spellfile= + $put ='' + $put ='test '. a:aff . '-' . a:dic + " Generate a .spl file from a .dic and .aff file. + exe '1;/^' . a:aff . 'affstart/+1,/^' . a:aff . 'affend/-1w! Xtest.aff' + exe '1;/^' . a:dic . 'dicstart/+1,/^' . a:dic . 'dicend/-1w! Xtest.dic' + mkspell! Xtest Xtest + " Use that spell file. + set spl=Xtest.utf-8.spl spell + " List all valid words. + spelldump + %yank + quit + $put + $put ='-------' + " Find all bad words and suggestions for them. + exe '1;/^' . a:aff . 'good:' + normal 0f:]s + let prevbad = '' + while 1 + let [bad, a] = spellbadword() + if bad == '' || bad == prevbad || bad == 'badend' + break + endif + let prevbad = bad + let lst = spellsuggest(bad, 3) + normal mm + $put =bad + $put =string(lst) + normal `m]s + endwhile + endfunc + ]]) execute([[call TestOne('1', '1')]]) execute([[$put =soundfold('goobledygoook')]]) -- cgit From ffe88f0d52516395b3de4983c88e795a76debf27 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Wed, 15 Jul 2015 13:01:30 +0200 Subject: test59: Save source file in utf8, this will mess up a lot of characters. --- .../legacy/059_utf8_spell_checking_spec.lua | 216 ++++++++++----------- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/test/functional/legacy/059_utf8_spell_checking_spec.lua b/test/functional/legacy/059_utf8_spell_checking_spec.lua index 817d9ad5b4..272e12129f 100644 --- a/test/functional/legacy/059_utf8_spell_checking_spec.lua +++ b/test/functional/legacy/059_utf8_spell_checking_spec.lua @@ -11,13 +11,13 @@ describe("spell checking with 'encoding' set to utf-8", function() insert([[ 1affstart SET ISO8859-1 - TRY esianrtolcdugmphbyfvkwjkqxz-'ESIANRTOLCDUGMPHBYFVKWJKQXZ + TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ - FOL - LOW - UPP + FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ - SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ޿ + SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ¿ SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep? MIDWORD '- @@ -49,24 +49,24 @@ describe("spell checking with 'encoding' set to utf-8", function() REP svp s.v.p. MAP 9 - MAP a - MAP e - MAP i - MAP o - MAP u - MAP n - MAP c - MAP y - MAP s + MAP aàáâãäå + MAP eèéêë + MAP iìíîï + MAP oòóôõö + MAP uùúûü + MAP nñ + MAP cç + MAP yÿý + MAP sß 1affend affstart_sal SET ISO8859-1 - TRY esianrtolcdugmphbyfvkwjkqxz-'ESIANRTOLCDUGMPHBYFVKWJKQXZ + TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ - FOL - LOW - UPP + FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ MIDWORD '- @@ -97,15 +97,15 @@ describe("spell checking with 'encoding' set to utf-8", function() REP svp s.v.p. MAP 9 - MAP a - MAP e - MAP i - MAP o - MAP u - MAP n - MAP c - MAP y - MAP s + MAP aàáâãäå + MAP eèéêë + MAP iìíîï + MAP oòóôõö + MAP uùúûü + MAP nñ + MAP cç + MAP yÿý + MAP sß SAL AH(AEIOUY)-^ *H SAL AR(AEIOUY)-^ *R @@ -114,8 +114,8 @@ describe("spell checking with 'encoding' set to utf-8", function() SAL AH(AEIOUY)- H SAL AR(AEIOUY)- R SAL A(HR) _ - SAL ^ * - SAL ^ * + SAL À^ * + SAL Å^ * SAL BB- _ SAL B B SAL CQ- _ @@ -129,7 +129,7 @@ describe("spell checking with 'encoding' set to utf-8", function() SAL DG(EIY) K SAL DD- _ SAL D T - SAL < E + SAL É< E SAL EH(AEIOUY)-^ *H SAL ER(AEIOUY)-^ *R SAL E(HR)^ * @@ -219,9 +219,9 @@ describe("spell checking with 'encoding' set to utf-8", function() 2affstart SET ISO8859-1 - FOL - LOW - UPP + FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ PFXPOSTPONE @@ -254,15 +254,15 @@ describe("spell checking with 'encoding' set to utf-8", function() REP svp s.v.p. MAP 9 - MAP a - MAP e - MAP i - MAP o - MAP u - MAP n - MAP c - MAP y - MAP s + MAP aàáâãäå + MAP eèéêë + MAP iìíîï + MAP oòóôõö + MAP uùúûü + MAP nñ + MAP cç + MAP yÿý + MAP sß 2affend 1dicstart @@ -276,7 +276,7 @@ describe("spell checking with 'encoding' set to utf-8", function() put/ISO the end deol - dr + déôr 1dicend addstart @@ -286,11 +286,11 @@ describe("spell checking with 'encoding' set to utf-8", function() addend 1good: wrong OK puts. Test the end - bad: inputs comment ok Ok. test déôl end the + bad: inputs comment ok Ok. test déôl end the badend 2good: puts - bad: inputs comment ok Ok end the. test déôl + bad: inputs comment ok Ok end the. test déôl badend Test rules for compounding. @@ -307,12 +307,12 @@ describe("spell checking with 'encoding' set to utf-8", function() 1234 foo/m bar/mx - m/m + mï/m la/mx 3dicend - 3good: foo mï foobar foofoobar barfoo barbarfoo - bad: bar la foomï barmï mïfoo mïbar mïmï lala mïla lamï foola labar + 3good: foo mï foobar foofoobar barfoo barbarfoo + bad: bar la foomï barmï mïfoo mïbar mïmï lala mïla lamï foola labar badend @@ -321,9 +321,9 @@ describe("spell checking with 'encoding' set to utf-8", function() 4affstart SET ISO8859-1 - FOL - LOW - UPP + FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ COMPOUNDRULE m+ COMPOUNDRULE sm*e @@ -333,18 +333,18 @@ describe("spell checking with 'encoding' set to utf-8", function() COMPOUNDFORBIDFLAG t COMPOUNDSYLMAX 5 - SYLLABLE aeiouy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui + SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui MAP 9 - MAP a - MAP e - MAP i - MAP o - MAP u - MAP n - MAP c - MAP y - MAP s + MAP aàáâãäå + MAP eèéêë + MAP iìíîï + MAP oòóôõö + MAP uùúûü + MAP nñ + MAP cç + MAP yÿý + MAP sß NEEDAFFIX x @@ -413,8 +413,8 @@ describe("spell checking with 'encoding' set to utf-8", function() SFX a1 Y 1 SFX a1 0 a1 . - SFX a Y 1 - SFX a 0 a . + SFX aé Y 1 + SFX aé 0 aé . PFX zz Y 1 PFX zz 0 pre/pp . @@ -425,14 +425,14 @@ describe("spell checking with 'encoding' set to utf-8", function() 5dicstart 1234 - foo/a1a!! + foo/a1aé!! bar/zz13ee start/ss end/eeyy middle/mmxx 5dicend - 5good: fooa1 fooaé bar prebar barbork prebarbork startprebar + 5good: fooa1 fooaé bar prebar barbork prebarbork startprebar start end startend startmiddleend nouend bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart startprobar startnouend @@ -457,8 +457,8 @@ describe("spell checking with 'encoding' set to utf-8", function() SFX A1 Y 1 SFX A1 0 a1 . - SFX A Y 1 - SFX A 0 a . + SFX Aé Y 1 + SFX Aé 0 aé . PFX Zz Y 1 PFX Zz 0 pre/p . @@ -466,14 +466,14 @@ describe("spell checking with 'encoding' set to utf-8", function() 6dicstart 1234 - mee/A1AA! + mee/A1AéA! bar/ZzN3Ee lead/s end/Ee middle/MmXx 6dicend - 6good: meea1 meeaé bar prebar barbork prebarbork leadprebar + 6good: meea1 meeaé bar prebar barbork prebarbork leadprebar lead end leadend leadmiddleend bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead leadprobar @@ -482,9 +482,9 @@ describe("spell checking with 'encoding' set to utf-8", function() 7affstart SET ISO8859-1 - FOL - LOW - UPP + FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ FLAG num @@ -502,7 +502,7 @@ describe("spell checking with 'encoding' set to utf-8", function() SFX 391 0 a1 . SFX 111 Y 1 - SFX 111 0 a . + SFX 111 0 aé . PFX 17 Y 1 PFX 17 0 pre/432 . @@ -517,7 +517,7 @@ describe("spell checking with 'encoding' set to utf-8", function() middle/77,1 7dicend - 7good: meea1 meeaé bar prebar barmeat prebarmeat leadprebar + 7good: meea1 meeaé bar prebar barmeat prebarmeat leadprebar lead tail leadtail leadmiddletail bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead leadprobar @@ -571,7 +571,7 @@ describe("spell checking with 'encoding' set to utf-8", function() execute([[call TestOne('1', '1')]]) execute([[$put =soundfold('goobledygoook')]]) - execute([[$put =soundfold('kóopërÿnôven')]]) + execute([[$put =soundfold('kóopërÿnôven')]]) execute([[$put =soundfold('oeverloos gezwets edale')]]) @@ -580,7 +580,7 @@ describe("spell checking with 'encoding' set to utf-8", function() execute(':/^affstart_sal/+1,/^affend_sal/-1w! Xtest.aff') execute('mkspell! Xtest Xtest') execute([[$put =soundfold('goobledygoook')]]) - execute([[$put =soundfold('kóopërÿnôven')]]) + execute([[$put =soundfold('kóopërÿnôven')]]) execute([[$put =soundfold('oeverloos gezwets edale')]]) -- Also use an addition file. @@ -650,7 +650,7 @@ describe("spell checking with 'encoding' set to utf-8", function() # file: Xtest.utf-8.spl Comment deol - déôr + déôr input OK output @@ -677,8 +677,8 @@ describe("spell checking with 'encoding' set to utf-8", function() ['OK', 'Uk', 'Put'] test ['Test', 'testn', 'testen'] - déôl - ['deol', 'déôr', 'test'] + déôl + ['deol', 'déôr', 'test'] end ['put', 'uk', 'test'] the @@ -703,7 +703,7 @@ describe("spell checking with 'encoding' set to utf-8", function() # file: Xtest.utf-8.spl Comment deol - déôr + déôr OK put input @@ -734,36 +734,36 @@ describe("spell checking with 'encoding' set to utf-8", function() ['put', 'uk', 'test'] test ['Test', 'testn', 'testen'] - déôl - ['deol', 'déôr', 'test'] + déôl + ['deol', 'déôr', 'test'] test 3-3 # file: Xtest.utf-8.spl foo - mï + mï ------- bad - ['foo', 'mï'] + ['foo', 'mï'] bar ['barfoo', 'foobar', 'foo'] la - ['mï', 'foo'] - foomï - ['foo mï', 'foo', 'foofoo'] - barmï - ['barfoo', 'mï', 'barbar'] - mïfoo - ['mï foo', 'foo', 'foofoo'] - mïbar - ['foobar', 'barbar', 'mï'] - mïmï - ['mï mï', 'mï'] + ['mï', 'foo'] + foomï + ['foo mï', 'foo', 'foofoo'] + barmï + ['barfoo', 'mï', 'barbar'] + mïfoo + ['mï foo', 'foo', 'foofoo'] + mïbar + ['foobar', 'barbar', 'mï'] + mïmï + ['mï mï', 'mï'] lala [] - mïla - ['mï', 'mï mï'] - lamï - ['mï', 'mï mï'] + mïla + ['mï', 'mï mï'] + lamï + ['mï', 'mï mï'] foola ['foo', 'foobar', 'foofoo'] labar @@ -822,7 +822,7 @@ describe("spell checking with 'encoding' set to utf-8", function() barbork end fooa1 - fooaé + fooaé nouend prebar prebarbork @@ -831,9 +831,9 @@ describe("spell checking with 'encoding' set to utf-8", function() bad ['bar', 'end', 'fooa1'] foo - ['fooa1', 'fooaé', 'bar'] + ['fooa1', 'fooaé', 'bar'] fooa2 - ['fooa1', 'fooaé', 'bar'] + ['fooa1', 'fooaé', 'bar'] prabar ['prebar', 'bar', 'bar bar'] probarbirk @@ -858,16 +858,16 @@ describe("spell checking with 'encoding' set to utf-8", function() end lead meea1 - meeaé + meeaé prebar prebarbork ------- bad ['bar', 'end', 'lead'] mee - ['meea1', 'meeaé', 'bar'] + ['meea1', 'meeaé', 'bar'] meea2 - ['meea1', 'meeaé', 'lead'] + ['meea1', 'meeaé', 'lead'] prabar ['prebar', 'bar', 'leadbar'] probarbirk @@ -889,7 +889,7 @@ describe("spell checking with 'encoding' set to utf-8", function() barmeat lead meea1 - meeaé + meeaé prebar prebarmeat tail @@ -897,9 +897,9 @@ describe("spell checking with 'encoding' set to utf-8", function() bad ['bar', 'lead', 'tail'] mee - ['meea1', 'meeaé', 'bar'] + ['meea1', 'meeaé', 'bar'] meea2 - ['meea1', 'meeaé', 'lead'] + ['meea1', 'meeaé', 'lead'] prabar ['prebar', 'bar', 'leadbar'] probarmaat -- cgit From f3c67a617e843506e31e5a1dc82eafa46cdfca22 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Wed, 15 Jul 2015 10:00:56 +0200 Subject: test59: Write spell files from lua and use cp to get the right files in place Use teardown to remove these temporary files --- .../legacy/059_utf8_spell_checking_spec.lua | 974 +++++++++++---------- 1 file changed, 504 insertions(+), 470 deletions(-) diff --git a/test/functional/legacy/059_utf8_spell_checking_spec.lua b/test/functional/legacy/059_utf8_spell_checking_spec.lua index 272e12129f..0f0a7907cf 100644 --- a/test/functional/legacy/059_utf8_spell_checking_spec.lua +++ b/test/functional/legacy/059_utf8_spell_checking_spec.lua @@ -3,287 +3,499 @@ local helpers = require('test.functional.helpers') local feed, insert, source = helpers.feed, helpers.insert, helpers.source local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect +local write_file = helpers.write_file describe("spell checking with 'encoding' set to utf-8", function() - setup(clear) - - it('is working', function() - insert([[ - 1affstart + setup(function() + clear() + -- This file should be encoded in ISO8859-1. + write_file('Xtest1.aff', + 'SET ISO8859-1\n' .. + 'TRY esianrtolcdugmphbyfvkwjkqxz-\xeb\xe9\xe8\xea\xef\xee\xe4\xe0' .. + '\xe2\xf6\xfc\xfb\'ESIANRTOLCDUGMPHBYFVKWJKQXZ\n' .. + '\n' .. + 'FOL \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. + '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. + '\xff\n' .. + 'LOW \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. + '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. + '\xff\n' .. + 'UPP \xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce' .. + '\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' .. + '\xff\n' .. + '\n' .. + 'SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\xe0' .. + '\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0' .. + '\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf\xff\xc0' .. + '\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0' .. + '\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xbf\n' .. + 'SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeee' .. + 'eceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep?\n' .. + '\n' .. + 'MIDWORD\t\'-\n' .. + '\n' .. + 'KEP =\n' .. + 'RAR ?\n' .. + 'BAD !\n' .. + '\n' .. + '#NOSPLITSUGS\n' .. + '\n' .. + 'PFX I N 1\n' .. + 'PFX I 0 in .\n' .. + '\n' .. + 'PFX O Y 1\n' .. + 'PFX O 0 out .\n' .. + '\n' .. + 'SFX S Y 2\n' .. + 'SFX S 0 s [^s]\n' .. + 'SFX S 0 es s\n' .. + '\n' .. + 'SFX N N 3\n' .. + 'SFX N 0 en [^n]\n' .. + 'SFX N 0 nen n\n' .. + 'SFX N 0 n .\n' .. + '\n' .. + 'REP 3\n' .. + 'REP g ch\n' .. + 'REP ch g\n' .. + 'REP svp s.v.p.\n' .. + '\n' .. + 'MAP 9\n' .. + 'MAP a\xe0\xe1\xe2\xe3\xe4\xe5\n' .. + 'MAP e\xe8\xe9\xea\xeb\n' .. + 'MAP i\xec\xed\xee\xef\n' .. + 'MAP o\xf2\xf3\xf4\xf5\xf6\n' .. + 'MAP u\xf9\xfa\xfb\xfc\n' .. + 'MAP n\xf1\n' .. + 'MAP c\xe7\n' .. + 'MAP y\xff\xfd\n' .. + 'MAP s\xdf\n') + write_file('Xtest1.dic', + '123456\n' .. + 'test/NO\n' .. + '# comment\n' .. + 'wrong\n' .. + 'Comment\n' .. + 'OK\n' .. + 'uk\n' .. + 'put/ISO\n' .. + 'the end\n' .. + 'deol\n' .. + '\x64\xe9\xf4\x72\n') + write_file('Xtest2.aff', + 'SET ISO8859-1\n' .. + '\n' .. + 'FOL \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. + '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. + '\xff\n' .. + 'LOW \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. + '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. + '\xff\n' .. + 'UPP \xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce' .. + '\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' .. + '\xff\n' .. + '\n' .. + 'PFXPOSTPONE\n' .. + '\n' .. + 'MIDWORD\t\'-\n' .. + '\n' .. + 'KEP =\n' .. + 'RAR ?\n' .. + 'BAD !\n' .. + '\n' .. + '#NOSPLITSUGS\n' .. + '\n' .. + 'PFX I N 1\n' .. + 'PFX I 0 in .\n' .. + '\n' .. + 'PFX O Y 1\n' .. + 'PFX O 0 out [a-z]\n' .. + '\n' .. + 'SFX S Y 2\n' .. + 'SFX S 0 s [^s]\n' .. + 'SFX S 0 es s\n' .. + '\n' .. + 'SFX N N 3\n' .. + 'SFX N 0 en [^n]\n' .. + 'SFX N 0 nen n\n' .. + 'SFX N 0 n .\n' .. + '\n' .. + 'REP 3\n' .. + 'REP g ch\n' .. + 'REP ch g\n' .. + 'REP svp s.v.p.\n' .. + '\n' .. + 'MAP 9\n' .. + 'MAP a\xe0\xe1\xe2\xe3\xe4\xe5\n' .. + 'MAP e\xe8\xe9\xea\xeb\n' .. + 'MAP i\xec\xed\xee\xef\n' .. + 'MAP o\xf2\xf3\xf4\xf5\xf6\n' .. + 'MAP u\xf9\xfa\xfb\xfc\n' .. + 'MAP n\xf1\n' .. + 'MAP c\xe7\n' .. + 'MAP y\xff\xfd\n' .. + 'MAP s\xdf\n') + write_file('Xtest3.aff', [[ SET ISO8859-1 - TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ - - FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ - LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ - UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ - - SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ¿ - SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep? - - MIDWORD '- - - KEP = - RAR ? - BAD ! - - #NOSPLITSUGS - - PFX I N 1 - PFX I 0 in . - - PFX O Y 1 - PFX O 0 out . - - SFX S Y 2 - SFX S 0 s [^s] - SFX S 0 es s - - SFX N N 3 - SFX N 0 en [^n] - SFX N 0 nen n - SFX N 0 n . - - REP 3 - REP g ch - REP ch g - REP svp s.v.p. - - MAP 9 - MAP aàáâãäå - MAP eèéêë - MAP iìíîï - MAP oòóôõö - MAP uùúûü - MAP nñ - MAP cç - MAP yÿý - MAP sß - 1affend - - affstart_sal - SET ISO8859-1 - TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ - - FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ - LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ - UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ - - MIDWORD '- - - KEP = - RAR ? - BAD ! - - #NOSPLITSUGS - - PFX I N 1 - PFX I 0 in . - - PFX O Y 1 - PFX O 0 out . - - SFX S Y 2 - SFX S 0 s [^s] - SFX S 0 es s - - SFX N N 3 - SFX N 0 en [^n] - SFX N 0 nen n - SFX N 0 n . - - REP 3 - REP g ch - REP ch g - REP svp s.v.p. - - MAP 9 - MAP aàáâãäå - MAP eèéêë - MAP iìíîï - MAP oòóôõö - MAP uùúûü - MAP nñ - MAP cç - MAP yÿý - MAP sß - - SAL AH(AEIOUY)-^ *H - SAL AR(AEIOUY)-^ *R - SAL A(HR)^ * - SAL A^ * - SAL AH(AEIOUY)- H - SAL AR(AEIOUY)- R - SAL A(HR) _ - SAL À^ * - SAL Å^ * - SAL BB- _ - SAL B B - SAL CQ- _ - SAL CIA X - SAL CH X - SAL C(EIY)- S - SAL CK K - SAL COUGH^ KF - SAL CC< C - SAL C K - SAL DG(EIY) K - SAL DD- _ - SAL D T - SAL É< E - SAL EH(AEIOUY)-^ *H - SAL ER(AEIOUY)-^ *R - SAL E(HR)^ * - SAL ENOUGH^$ *NF - SAL E^ * - SAL EH(AEIOUY)- H - SAL ER(AEIOUY)- R - SAL E(HR) _ - SAL FF- _ - SAL F F - SAL GN^ N - SAL GN$ N - SAL GNS$ NS - SAL GNED$ N - SAL GH(AEIOUY)- K - SAL GH _ - SAL GG9 K - SAL G K - SAL H H - SAL IH(AEIOUY)-^ *H - SAL IR(AEIOUY)-^ *R - SAL I(HR)^ * - SAL I^ * - SAL ING6 N - SAL IH(AEIOUY)- H - SAL IR(AEIOUY)- R - SAL I(HR) _ - SAL J K - SAL KN^ N - SAL KK- _ - SAL K K - SAL LAUGH^ LF - SAL LL- _ - SAL L L - SAL MB$ M - SAL MM M - SAL M M - SAL NN- _ - SAL N N - SAL OH(AEIOUY)-^ *H - SAL OR(AEIOUY)-^ *R - SAL O(HR)^ * - SAL O^ * - SAL OH(AEIOUY)- H - SAL OR(AEIOUY)- R - SAL O(HR) _ - SAL PH F - SAL PN^ N - SAL PP- _ - SAL P P - SAL Q K - SAL RH^ R - SAL ROUGH^ RF - SAL RR- _ - SAL R R - SAL SCH(EOU)- SK - SAL SC(IEY)- S - SAL SH X - SAL SI(AO)- X - SAL SS- _ - SAL S S - SAL TI(AO)- X - SAL TH @ - SAL TCH-- _ - SAL TOUGH^ TF - SAL TT- _ - SAL T T - SAL UH(AEIOUY)-^ *H - SAL UR(AEIOUY)-^ *R - SAL U(HR)^ * - SAL U^ * - SAL UH(AEIOUY)- H - SAL UR(AEIOUY)- R - SAL U(HR) _ - SAL V^ W - SAL V F - SAL WR^ R - SAL WH^ W - SAL W(AEIOU)- W - SAL X^ S - SAL X KS - SAL Y(AEIOU)- Y - SAL ZZ- _ - SAL Z S - affend_sal - - 2affstart - SET ISO8859-1 - - FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ - LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ - UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ - - PFXPOSTPONE - - MIDWORD '- - - KEP = - RAR ? - BAD ! - - #NOSPLITSUGS - - PFX I N 1 - PFX I 0 in . - - PFX O Y 1 - PFX O 0 out [a-z] - - SFX S Y 2 - SFX S 0 s [^s] - SFX S 0 es s - SFX N N 3 - SFX N 0 en [^n] - SFX N 0 nen n - SFX N 0 n . - - REP 3 - REP g ch - REP ch g - REP svp s.v.p. - - MAP 9 - MAP aàáâãäå - MAP eèéêë - MAP iìíîï - MAP oòóôõö - MAP uùúûü - MAP nñ - MAP cç - MAP yÿý - MAP sß - 2affend - - 1dicstart - 123456 - test/NO - # comment - wrong - Comment - OK - uk - put/ISO - the end - deol - déôr - 1dicend - - addstart + COMPOUNDMIN 3 + COMPOUNDRULE m* + NEEDCOMPOUND x + ]]) + write_file('Xtest3.dic', + '1234\nfoo/m\nbar/mx\n\x6d\xef\x2f\x6d\n\x6c\x61\x2f\x6d\x78\n') + write_file('Xtest4.aff', + 'SET ISO8859-1\n' .. + '\n' .. + 'FOL \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. + '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. + '\xff\n' .. + 'LOW \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. + '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. + '\xff\n' .. + 'UPP \xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce' .. + '\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' .. + '\xff\n' .. + '\n' .. + 'COMPOUNDRULE m+\n' .. + 'COMPOUNDRULE sm*e\n' .. + 'COMPOUNDRULE sm+\n' .. + 'COMPOUNDMIN 3\n' .. + 'COMPOUNDWORDMAX 3\n' .. + 'COMPOUNDFORBIDFLAG t\n' .. + '\n' .. + 'COMPOUNDSYLMAX 5\n' .. + 'SYLLABLE a\xe1e\xe9i\xedo\xf3\xf6\xf5u\xfa\xfc\xfby/aa/au/ea/ee/ei/' .. + 'ie/oa/oe/oo/ou/uu/ui\n' .. + '\n' .. + 'MAP 9\n' .. + 'MAP a\xe0\xe1\xe2\xe3\xe4\xe5\n' .. + 'MAP e\xe8\xe9\xea\xeb\n' .. + 'MAP i\xec\xed\xee\xef\n' .. + 'MAP o\xf2\xf3\xf4\xf5\xf6\n' .. + 'MAP u\xf9\xfa\xfb\xfc\n' .. + 'MAP n\xf1\n' .. + 'MAP c\xe7\n' .. + 'MAP y\xff\xfd\n' .. + 'MAP s\xdf\n' .. + '\n' .. + 'NEEDAFFIX x\n' .. + '\n' .. + 'PFXPOSTPONE\n' .. + '\n' .. + 'MIDWORD \'-\n' .. + '\n' .. + 'SFX q N 1\n' .. + 'SFX q 0 -ok .\n' .. + '\n' .. + 'SFX a Y 2\n' .. + 'SFX a 0 s .\n' .. + 'SFX a 0 ize/t .\n' .. + '\n' .. + 'PFX p N 1\n' .. + 'PFX p 0 pre .\n' .. + '\n' .. + 'PFX P N 1\n' .. + 'PFX P 0 nou .\n') + write_file('Xtest4.dic', [[ + 1234 + word/mP + util/am + pro/xq + tomato/m + bork/mp + start/s + end/e + ]]) + write_file('Xtest5.aff', + 'SET ISO8859-1\n' .. + '\n' .. + 'FLAG long\n' .. + '\n' .. + 'NEEDAFFIX !!\n' .. + '\n' .. + 'COMPOUNDRULE ssmm*ee\n' .. + '\n' .. + 'NEEDCOMPOUND xx\n' .. + 'COMPOUNDPERMITFLAG pp\n' .. + '\n' .. + 'SFX 13 Y 1\n' .. + 'SFX 13 0 bork .\n' .. + '\n' .. + 'SFX a1 Y 1\n' .. + 'SFX a1 0 a1 .\n' .. + '\n' .. + 'SFX a\xe9 Y 1\n' .. + 'SFX a\xe9 0 a\xe9 .\n' .. + '\n' .. + 'PFX zz Y 1\n' .. + 'PFX zz 0 pre/pp .\n' .. + '\n' .. + 'PFX yy Y 1\n' .. + 'PFX yy 0 nou .\n') + write_file('Xtest5.dic', + '1234\nfoo/a1a\xe9!!\nbar/zz13ee\nstart/ss\nend/eeyy\nmiddle/mmxx\n') + write_file('Xtest6.aff', + 'SET ISO8859-1\n' .. + '\n' .. + 'FLAG caplong\n' .. + '\n' .. + 'NEEDAFFIX A!\n' .. + '\n' .. + 'COMPOUNDRULE sMm*Ee\n' .. + '\n' .. + 'NEEDCOMPOUND Xx\n' .. + '\n' .. + 'COMPOUNDPERMITFLAG p\n' .. + '\n' .. + 'SFX N3 Y 1\n' .. + 'SFX N3 0 bork .\n' .. + '\n' .. + 'SFX A1 Y 1\n' .. + 'SFX A1 0 a1 .\n' .. + '\n' .. + 'SFX A\xe9 Y 1\n' .. + 'SFX A\xe9 0 a\xe9 .\n' .. + '\n' .. + 'PFX Zz Y 1\n' .. + 'PFX Zz 0 pre/p .\n') + write_file('Xtest6.dic', + '1234\nmee/A1A\xe9A!\nbar/ZzN3Ee\nlead/s\nend/Ee\nmiddle/MmXx\n') + write_file('Xtest7.aff', + 'SET ISO8859-1\n' .. + '\n' .. + 'FOL \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. + '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. + '\xff\n' .. + 'LOW \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. + '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. + '\xff\n' .. + 'UPP \xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce' .. + '\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' .. + '\xff\n' .. + '\n' .. + 'FLAG num\n' .. + '\n' .. + 'NEEDAFFIX 9999\n' .. + '\n' .. + 'COMPOUNDRULE 2,77*123\n' .. + '\n' .. + 'NEEDCOMPOUND 1\n' .. + 'COMPOUNDPERMITFLAG 432\n' .. + '\n' .. + 'SFX 61003 Y 1\n' .. + 'SFX 61003 0 meat .\n' .. + '\n' .. + 'SFX 391 Y 1\n' .. + 'SFX 391 0 a1 .\n' .. + '\n' .. + 'SFX 111 Y 1\n' .. + 'SFX 111 0 a\xe9'.. + ' .\n' .. + '\n' .. + 'PFX 17 Y 1\n' .. + 'PFX 17 0 pre/432 .\n') + write_file('Xtest7.dic', [[ + 1234 + mee/391,111,9999 + bar/17,61003,123 + lead/2 + tail/123 + middle/77,1 + ]]) + write_file('Xtest-sal.aff', + 'SET ISO8859-1\n' .. + 'TRY esianrtolcdugmphbyfvkwjkqxz-\xeb\xe9\xe8\xea\xef\xee\xe4\xe0' .. + '\xe2\xf6\xfc\xfb\'ESIANRTOLCDUGMPHBYFVKWJKQXZ\n' .. + '\n' .. + 'FOL \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. + '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. + '\xff\n' .. + 'LOW \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. + '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. + '\xff\n' .. + 'UPP \xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce' .. + '\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' .. + '\xff\n' .. + '\n' .. + 'MIDWORD\t\'-\n' .. + '\n' .. + 'KEP =\n' .. + 'RAR ?\n' .. + 'BAD !\n' .. + '\n' .. + '#NOSPLITSUGS\n' .. + '\n' .. + 'PFX I N 1\n' .. + 'PFX I 0 in .\n' .. + '\n' .. + 'PFX O Y 1\n' .. + 'PFX O 0 out .\n' .. + '\n' .. + 'SFX S Y 2\n' .. + 'SFX S 0 s [^s]\n' .. + 'SFX S 0 es s\n' .. + '\n' .. + 'SFX N N 3\n' .. + 'SFX N 0 en [^n]\n' .. + 'SFX N 0 nen n\n' .. + 'SFX N 0 n .\n' .. + '\n' .. + 'REP 3\n' .. + 'REP g ch\n' .. + 'REP ch g\n' .. + 'REP svp s.v.p.\n' .. + '\n' .. + 'MAP 9\n' .. + 'MAP a\xe0\xe1\xe2\xe3\xe4\xe5\n' .. + 'MAP e\xe8\xe9\xea\xeb\n' .. + 'MAP i\xec\xed\xee\xef\n' .. + 'MAP o\xf2\xf3\xf4\xf5\xf6\n' .. + 'MAP u\xf9\xfa\xfb\xfc\n' .. + 'MAP n\xf1\n' .. + 'MAP c\xe7\n' .. + 'MAP y\xff\xfd\n' .. + 'MAP s\xdf\n' .. + '\n' .. + 'SAL AH(AEIOUY)-^ *H\n' .. + 'SAL AR(AEIOUY)-^ *R\n' .. + 'SAL A(HR)^ *\n' .. + 'SAL A^ *\n' .. + 'SAL AH(AEIOUY)- H\n' .. + 'SAL AR(AEIOUY)- R\n' .. + 'SAL A(HR) _\n' .. + 'SAL \xc0^ *\n' .. + 'SAL \xc5^ *\n' .. + 'SAL BB- _\n' .. + 'SAL B B\n' .. + 'SAL CQ- _\n' .. + 'SAL CIA X\n' .. + 'SAL CH X\n' .. + 'SAL C(EIY)- S\n' .. + 'SAL CK K\n' .. + 'SAL COUGH^ KF\n' .. + 'SAL CC< C\n' .. + 'SAL C K\n' .. + 'SAL DG(EIY) K\n' .. + 'SAL DD- _\n' .. + 'SAL D T\n' .. + 'SAL \xc9< E\n' .. + 'SAL EH(AEIOUY)-^ *H\n' .. + 'SAL ER(AEIOUY)-^ *R\n' .. + 'SAL E(HR)^ *\n' .. + 'SAL ENOUGH^$ *NF\n' .. + 'SAL E^ *\n' .. + 'SAL EH(AEIOUY)- H\n' .. + 'SAL ER(AEIOUY)- R\n' .. + 'SAL E(HR) _\n' .. + 'SAL FF- _\n' .. + 'SAL F F\n' .. + 'SAL GN^ N\n' .. + 'SAL GN$ N\n' .. + 'SAL GNS$ NS\n' .. + 'SAL GNED$ N\n' .. + 'SAL GH(AEIOUY)- K\n' .. + 'SAL GH _\n' .. + 'SAL GG9 K\n' .. + 'SAL G K\n' .. + 'SAL H H\n' .. + 'SAL IH(AEIOUY)-^ *H\n' .. + 'SAL IR(AEIOUY)-^ *R\n' .. + 'SAL I(HR)^ *\n' .. + 'SAL I^ *\n' .. + 'SAL ING6 N\n' .. + 'SAL IH(AEIOUY)- H\n' .. + 'SAL IR(AEIOUY)- R\n' .. + 'SAL I(HR) _\n' .. + 'SAL J K\n' .. + 'SAL KN^ N\n' .. + 'SAL KK- _\n' .. + 'SAL K K\n' .. + 'SAL LAUGH^ LF\n' .. + 'SAL LL- _\n' .. + 'SAL L L\n' .. + 'SAL MB$ M\n' .. + 'SAL MM M\n' .. + 'SAL M M\n' .. + 'SAL NN- _\n' .. + 'SAL N N\n' .. + 'SAL OH(AEIOUY)-^ *H\n' .. + 'SAL OR(AEIOUY)-^ *R\n' .. + 'SAL O(HR)^ *\n' .. + 'SAL O^ *\n' .. + 'SAL OH(AEIOUY)- H\n' .. + 'SAL OR(AEIOUY)- R\n' .. + 'SAL O(HR) _\n' .. + 'SAL PH F\n' .. + 'SAL PN^ N\n' .. + 'SAL PP- _\n' .. + 'SAL P P\n' .. + 'SAL Q K\n' .. + 'SAL RH^ R\n' .. + 'SAL ROUGH^ RF\n' .. + 'SAL RR- _\n' .. + 'SAL R R\n' .. + 'SAL SCH(EOU)- SK\n' .. + 'SAL SC(IEY)- S\n' .. + 'SAL SH X\n' .. + 'SAL SI(AO)- X\n' .. + 'SAL SS- _\n' .. + 'SAL S S\n' .. + 'SAL TI(AO)- X\n' .. + 'SAL TH @\n' .. + 'SAL TCH-- _\n' .. + 'SAL TOUGH^ TF\n' .. + 'SAL TT- _\n' .. + 'SAL T T\n' .. + 'SAL UH(AEIOUY)-^ *H\n' .. + 'SAL UR(AEIOUY)-^ *R\n' .. + 'SAL U(HR)^ *\n' .. + 'SAL U^ *\n' .. + 'SAL UH(AEIOUY)- H\n' .. + 'SAL UR(AEIOUY)- R\n' .. + 'SAL U(HR) _\n' .. + 'SAL V^ W\n' .. + 'SAL V F\n' .. + 'SAL WR^ R\n' .. + 'SAL WH^ W\n' .. + 'SAL W(AEIOU)- W\n' .. + 'SAL X^ S\n' .. + 'SAL X KS\n' .. + 'SAL Y(AEIOU)- Y\n' .. + 'SAL ZZ- _\n' .. + 'SAL Z S\n') + write_file('Xtest.utf-8.add', [[ /regions=usgbnz elequint/2 elekwint/3 - addend + ]]) + end) + + teardown(function() + os.remove('Xtest-sal.aff') + os.remove('Xtest.aff') + os.remove('Xtest.dic') + os.remove('Xtest.utf-8.add') + os.remove('Xtest.utf-8.add.spl') + os.remove('Xtest.utf-8.spl') + os.remove('Xtest.utf-8.sug') + os.remove('Xtest1.aff') + os.remove('Xtest1.dic') + os.remove('Xtest2.aff') + os.remove('Xtest3.aff') + os.remove('Xtest3.dic') + os.remove('Xtest4.aff') + os.remove('Xtest4.dic') + os.remove('Xtest5.aff') + os.remove('Xtest5.dic') + os.remove('Xtest6.aff') + os.remove('Xtest6.dic') + os.remove('Xtest7.aff') + os.remove('Xtest7.dic') + end) + + it('is working', function() + insert([[ 1good: wrong OK puts. Test the end bad: inputs comment ok Ok. test déôl end the @@ -295,22 +507,6 @@ describe("spell checking with 'encoding' set to utf-8", function() Test rules for compounding. - 3affstart - SET ISO8859-1 - - COMPOUNDMIN 3 - COMPOUNDRULE m* - NEEDCOMPOUND x - 3affend - - 3dicstart - 1234 - foo/m - bar/mx - mï/m - la/mx - 3dicend - 3good: foo mï foobar foofoobar barfoo barbarfoo bad: bar la foomï barmï mïfoo mïbar mïmï lala mïla lamï foola labar badend @@ -318,65 +514,6 @@ describe("spell checking with 'encoding' set to utf-8", function() Tests for compounding. - 4affstart - SET ISO8859-1 - - FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ - LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ - UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ - - COMPOUNDRULE m+ - COMPOUNDRULE sm*e - COMPOUNDRULE sm+ - COMPOUNDMIN 3 - COMPOUNDWORDMAX 3 - COMPOUNDFORBIDFLAG t - - COMPOUNDSYLMAX 5 - SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui - - MAP 9 - MAP aàáâãäå - MAP eèéêë - MAP iìíîï - MAP oòóôõö - MAP uùúûü - MAP nñ - MAP cç - MAP yÿý - MAP sß - - NEEDAFFIX x - - PFXPOSTPONE - - MIDWORD '- - - SFX q N 1 - SFX q 0 -ok . - - SFX a Y 2 - SFX a 0 s . - SFX a 0 ize/t . - - PFX p N 1 - PFX p 0 pre . - - PFX P N 1 - PFX P 0 nou . - 4affend - - 4dicstart - 1234 - word/mP - util/am - pro/xq - tomato/m - bork/mp - start/s - end/e - 4dicend - 4good: word util bork prebork start end wordutil wordutils pro-ok bork borkbork borkborkbork borkborkborkbork borkborkborkborkbork tomato tomatotomato startend startword startwordword startwordend @@ -395,128 +532,18 @@ describe("spell checking with 'encoding' set to utf-8", function() Test affix flags with two characters - 5affstart - SET ISO8859-1 - - FLAG long - - NEEDAFFIX !! - - COMPOUNDRULE ssmm*ee - - NEEDCOMPOUND xx - COMPOUNDPERMITFLAG pp - - SFX 13 Y 1 - SFX 13 0 bork . - - SFX a1 Y 1 - SFX a1 0 a1 . - - SFX aé Y 1 - SFX aé 0 aé . - - PFX zz Y 1 - PFX zz 0 pre/pp . - - PFX yy Y 1 - PFX yy 0 nou . - 5affend - - 5dicstart - 1234 - foo/a1aé!! - bar/zz13ee - start/ss - end/eeyy - middle/mmxx - 5dicend - 5good: fooa1 fooaé bar prebar barbork prebarbork startprebar start end startend startmiddleend nouend bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart startprobar startnouend badend - 6affstart - SET ISO8859-1 - - FLAG caplong - - NEEDAFFIX A! - - COMPOUNDRULE sMm*Ee - - NEEDCOMPOUND Xx - - COMPOUNDPERMITFLAG p - - SFX N3 Y 1 - SFX N3 0 bork . - - SFX A1 Y 1 - SFX A1 0 a1 . - - SFX Aé Y 1 - SFX Aé 0 aé . - - PFX Zz Y 1 - PFX Zz 0 pre/p . - 6affend - - 6dicstart - 1234 - mee/A1AéA! - bar/ZzN3Ee - lead/s - end/Ee - middle/MmXx - 6dicend - 6good: meea1 meeaé bar prebar barbork prebarbork leadprebar lead end leadend leadmiddleend bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead leadprobar badend - 7affstart - SET ISO8859-1 - - FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ - LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ - UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ - - FLAG num - - NEEDAFFIX 9999 - - COMPOUNDRULE 2,77*123 - - NEEDCOMPOUND 1 - COMPOUNDPERMITFLAG 432 - - SFX 61003 Y 1 - SFX 61003 0 meat . - - SFX 391 Y 1 - SFX 391 0 a1 . - - SFX 111 Y 1 - SFX 111 0 aé . - - PFX 17 Y 1 - PFX 17 0 pre/432 . - 7affend - - 7dicstart - 1234 - mee/391,111,9999 - bar/17,61003,123 - lead/2 - tail/123 - middle/77,1 - 7dicend - 7good: meea1 meeaé bar prebar barmeat prebarmeat leadprebar lead tail leadtail leadmiddletail bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead @@ -525,22 +552,17 @@ describe("spell checking with 'encoding' set to utf-8", function() test output:]]) - -- Don't want to depend on the locale from the environment. The .aff and .dic. - -- Text is in latin1, the test text is utf-8. - execute('set enc=latin1') - execute('e!') - execute('set enc=utf-8') - execute('set fenc=') - -- Function to test .aff/.dic with list of good and bad words. + os.execute('cp -f Xtest1.aff Xtest.aff') + os.execute('cp -f Xtest1.dic Xtest.dic') source([[ func TestOne(aff, dic) set spellfile= $put ='' $put ='test '. a:aff . '-' . a:dic " Generate a .spl file from a .dic and .aff file. - exe '1;/^' . a:aff . 'affstart/+1,/^' . a:aff . 'affend/-1w! Xtest.aff' - exe '1;/^' . a:dic . 'dicstart/+1,/^' . a:dic . 'dicend/-1w! Xtest.dic' + exe '!cp -f Xtest'.a:aff.'.aff Xtest.aff' + exe '!cp -f Xtest'.a:dic.'.dic Xtest.dic' mkspell! Xtest Xtest " Use that spell file. set spl=Xtest.utf-8.spl spell @@ -577,7 +599,7 @@ describe("spell checking with 'encoding' set to utf-8", function() -- And now with SAL instead of SOFO items; test automatic reloading. feed('gg') - execute(':/^affstart_sal/+1,/^affend_sal/-1w! Xtest.aff') + os.execute('cp -f Xtest-sal.aff Xtest.aff') execute('mkspell! Xtest Xtest') execute([[$put =soundfold('goobledygoook')]]) execute([[$put =soundfold('kóopërÿnôven')]]) @@ -585,7 +607,6 @@ describe("spell checking with 'encoding' set to utf-8", function() -- Also use an addition file. feed('gg') - execute(':/^addstart/+1,/^addend/-1w! Xtest.utf-8.add') execute('mkspell! Xtest.utf-8.add.spl Xtest.utf-8.add') execute('set spellfile=Xtest.utf-8.add') execute('/^test2:') @@ -625,15 +646,28 @@ describe("spell checking with 'encoding' set to utf-8", function() execute('let [str, a] = spellbadword()') execute('$put =str') execute('unlet str a') + --helpers.eq(1,2) -- Postponed prefixes. + os.execute('cp -f Xtest2.aff Xtest.aff') + os.execute('cp -f Xtest1.dic Xtest.dic') execute([[call TestOne('2', '1')]]) -- Compound words. + os.execute('cp -f Xtest3.aff Xtest.aff') + os.execute('cp -f Xtest3.dic Xtest.dic') execute([[call TestOne('3', '3')]]) + os.execute('cp -f Xtest4.aff Xtest.aff') + os.execute('cp -f Xtest4.dic Xtest.dic') execute([[call TestOne('4', '4')]]) + os.execute('cp -f Xtest5.aff Xtest.aff') + os.execute('cp -f Xtest5.dic Xtest.dic') execute([[call TestOne('5', '5')]]) + os.execute('cp -f Xtest6.aff Xtest.aff') + os.execute('cp -f Xtest6.dic Xtest.dic') execute([[call TestOne('6', '6')]]) + os.execute('cp -f Xtest7.aff Xtest.aff') + os.execute('cp -f Xtest7.dic Xtest.dic') execute([[call TestOne('7', '7')]]) -- Clean up for valgrind. -- cgit From c7d58e7a56cf4d93667b24732eaef81197d383fc Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Thu, 16 Jul 2015 07:56:19 +0200 Subject: test59: Turn the VimL test function into a lua function. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Helped-By: Björn Linse `spelldump | quit` must be in a function --- .../legacy/059_utf8_spell_checking_spec.lua | 110 +++++++++------------ 1 file changed, 49 insertions(+), 61 deletions(-) diff --git a/test/functional/legacy/059_utf8_spell_checking_spec.lua b/test/functional/legacy/059_utf8_spell_checking_spec.lua index 0f0a7907cf..990012c169 100644 --- a/test/functional/legacy/059_utf8_spell_checking_spec.lua +++ b/test/functional/legacy/059_utf8_spell_checking_spec.lua @@ -494,6 +494,48 @@ describe("spell checking with 'encoding' set to utf-8", function() os.remove('Xtest7.dic') end) + -- Function to test .aff/.dic with list of good and bad words. This was a + -- Vim function in the original legacy test. + local function test_one(aff, dic) + -- Generate a .spl file from a .dic and .aff file. + os.execute('cp -f Xtest'..aff..'.aff Xtest.aff') + os.execute('cp -f Xtest'..dic..'.dic Xtest.dic') + source([[ + set spellfile= + function! SpellDumpNoShow() + " spelling scores depend on what happens to be drawn on screen + spelldump + %yank + quit + endfunction + $put ='' + $put ='test ]]..aff..'-'..dic..[[' + mkspell! Xtest Xtest + " Use that spell file. + set spl=Xtest.utf-8.spl spell + " List all valid words. + call SpellDumpNoShow() + $put + $put ='-------' + " Find all bad words and suggestions for them. + 1;/^]]..aff..[[good: + normal 0f:]s + let prevbad = '' + while 1 + let [bad, a] = spellbadword() + if bad == '' || bad == prevbad || bad == 'badend' + break + endif + let prevbad = bad + let lst = spellsuggest(bad, 3) + normal mm + $put =bad + $put =string(lst) + normal `m]s + endwhile + ]]) + end + it('is working', function() insert([[ @@ -552,51 +594,11 @@ describe("spell checking with 'encoding' set to utf-8", function() test output:]]) - -- Function to test .aff/.dic with list of good and bad words. - os.execute('cp -f Xtest1.aff Xtest.aff') - os.execute('cp -f Xtest1.dic Xtest.dic') - source([[ - func TestOne(aff, dic) - set spellfile= - $put ='' - $put ='test '. a:aff . '-' . a:dic - " Generate a .spl file from a .dic and .aff file. - exe '!cp -f Xtest'.a:aff.'.aff Xtest.aff' - exe '!cp -f Xtest'.a:dic.'.dic Xtest.dic' - mkspell! Xtest Xtest - " Use that spell file. - set spl=Xtest.utf-8.spl spell - " List all valid words. - spelldump - %yank - quit - $put - $put ='-------' - " Find all bad words and suggestions for them. - exe '1;/^' . a:aff . 'good:' - normal 0f:]s - let prevbad = '' - while 1 - let [bad, a] = spellbadword() - if bad == '' || bad == prevbad || bad == 'badend' - break - endif - let prevbad = bad - let lst = spellsuggest(bad, 3) - normal mm - $put =bad - $put =string(lst) - normal `m]s - endwhile - endfunc - ]]) - - execute([[call TestOne('1', '1')]]) + test_one(1, 1) execute([[$put =soundfold('goobledygoook')]]) execute([[$put =soundfold('kóopërÿnôven')]]) execute([[$put =soundfold('oeverloos gezwets edale')]]) - -- And now with SAL instead of SOFO items; test automatic reloading. feed('gg') os.execute('cp -f Xtest-sal.aff Xtest.aff') @@ -649,29 +651,15 @@ describe("spell checking with 'encoding' set to utf-8", function() --helpers.eq(1,2) -- Postponed prefixes. - os.execute('cp -f Xtest2.aff Xtest.aff') - os.execute('cp -f Xtest1.dic Xtest.dic') - execute([[call TestOne('2', '1')]]) + test_one(2, 1) -- Compound words. - os.execute('cp -f Xtest3.aff Xtest.aff') - os.execute('cp -f Xtest3.dic Xtest.dic') - execute([[call TestOne('3', '3')]]) - os.execute('cp -f Xtest4.aff Xtest.aff') - os.execute('cp -f Xtest4.dic Xtest.dic') - execute([[call TestOne('4', '4')]]) - os.execute('cp -f Xtest5.aff Xtest.aff') - os.execute('cp -f Xtest5.dic Xtest.dic') - execute([[call TestOne('5', '5')]]) - os.execute('cp -f Xtest6.aff Xtest.aff') - os.execute('cp -f Xtest6.dic Xtest.dic') - execute([[call TestOne('6', '6')]]) - os.execute('cp -f Xtest7.aff Xtest.aff') - os.execute('cp -f Xtest7.dic Xtest.dic') - execute([[call TestOne('7', '7')]]) + test_one(3, 3) + test_one(4, 4) + test_one(5, 5) + test_one(6, 6) + test_one(7, 7) - -- Clean up for valgrind. - execute('delfunc TestOne') execute('set spl= enc=latin1') execute('0,/^test output:/-1 delete') -- cgit From a412e72a2f5b1b1873546dfa23fe2c600b2da052 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Thu, 16 Jul 2015 08:03:32 +0200 Subject: test59: Split tests into 1-1, etc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Helped-By: Björn Linse Fixed some output issues --- .../legacy/059_utf8_spell_checking_spec.lua | 182 +++++++++++---------- 1 file changed, 97 insertions(+), 85 deletions(-) diff --git a/test/functional/legacy/059_utf8_spell_checking_spec.lua b/test/functional/legacy/059_utf8_spell_checking_spec.lua index 990012c169..52808b0814 100644 --- a/test/functional/legacy/059_utf8_spell_checking_spec.lua +++ b/test/functional/legacy/059_utf8_spell_checking_spec.lua @@ -536,79 +536,26 @@ describe("spell checking with 'encoding' set to utf-8", function() ]]) end - it('is working', function() + it('part 1-1', function() insert([[ - 1good: wrong OK puts. Test the end bad: inputs comment ok Ok. test déôl end the badend - 2good: puts - bad: inputs comment ok Ok end the. test déôl - badend - - Test rules for compounding. - - 3good: foo mï foobar foofoobar barfoo barbarfoo - bad: bar la foomï barmï mïfoo mïbar mïmï lala mïla lamï foola labar - badend - - - Tests for compounding. - - 4good: word util bork prebork start end wordutil wordutils pro-ok - bork borkbork borkborkbork borkborkborkbork borkborkborkborkbork - tomato tomatotomato startend startword startwordword startwordend - startwordwordend startwordwordwordend prebork preborkbork - preborkborkbork - nouword - bad: wordutilize pro borkborkborkborkborkbork tomatotomatotomato - endstart endend startstart wordend wordstart - preborkprebork preborkpreborkbork - startwordwordwordwordend borkpreborkpreborkbork - utilsbork startnouword - badend - test2: elequint test elekwint test elekwent asdf - - Test affix flags with two characters - - 5good: fooa1 fooaé bar prebar barbork prebarbork startprebar - start end startend startmiddleend nouend - bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart - startprobar startnouend - badend - - 6good: meea1 meeaé bar prebar barbork prebarbork leadprebar - lead end leadend leadmiddleend - bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead - leadprobar - badend - - 7good: meea1 meeaé bar prebar barmeat prebarmeat leadprebar - lead tail leadtail leadmiddletail - bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead - leadprobar - badend - - test output:]]) - + ]]) test_one(1, 1) execute([[$put =soundfold('goobledygoook')]]) execute([[$put =soundfold('kóopërÿnôven')]]) execute([[$put =soundfold('oeverloos gezwets edale')]]) - -- And now with SAL instead of SOFO items; test automatic reloading. - feed('gg') os.execute('cp -f Xtest-sal.aff Xtest.aff') execute('mkspell! Xtest Xtest') execute([[$put =soundfold('goobledygoook')]]) execute([[$put =soundfold('kóopërÿnôven')]]) execute([[$put =soundfold('oeverloos gezwets edale')]]) - -- Also use an addition file. - feed('gg') execute('mkspell! Xtest.utf-8.add.spl Xtest.utf-8.add') execute('set spellfile=Xtest.utf-8.add') execute('/^test2:') @@ -647,27 +594,8 @@ describe("spell checking with 'encoding' set to utf-8", function() feed('`m]s') execute('let [str, a] = spellbadword()') execute('$put =str') - execute('unlet str a') - --helpers.eq(1,2) - - -- Postponed prefixes. - test_one(2, 1) - - -- Compound words. - test_one(3, 3) - test_one(4, 4) - test_one(5, 5) - test_one(6, 6) - test_one(7, 7) - - execute('set spl= enc=latin1') - - execute('0,/^test output:/-1 delete') - - -- Assert buffer contents. - expect([=[ - test output: - + execute('1,/^test 1-1/-1d') + expect([[ test 1-1 # file: Xtest.utf-8.spl Comment @@ -719,8 +647,19 @@ describe("spell checking with 'encoding' set to utf-8", function() elequint elekwent elequint - elekwint - + elekwint]]) + end) + + it('part 2-1', function() + insert([[ + 2good: puts + bad: inputs comment ok Ok end the. test déôl + badend + ]]) + -- Postponed prefixes. + test_one(2, 1) + execute('1,/^test 2-1/-1d') + expect([=[ test 2-1 # file: Xtest.utf-8.spl Comment @@ -757,8 +696,20 @@ describe("spell checking with 'encoding' set to utf-8", function() test ['Test', 'testn', 'testen'] déôl - ['deol', 'déôr', 'test'] + ['deol', 'déôr', 'test']]=]) + end) + + it('part 3-3', function() + insert([[ + Test rules for compounding. + 3good: foo mï foobar foofoobar barfoo barbarfoo + bad: bar la foomï barmï mïfoo mïbar mïmï lala mïla lamï foola labar + badend + ]]) + test_one(3, 3) + execute('1,/^test 3-3/-1d') + expect([=[ test 3-3 # file: Xtest.utf-8.spl foo @@ -789,8 +740,29 @@ describe("spell checking with 'encoding' set to utf-8", function() foola ['foo', 'foobar', 'foofoo'] labar - ['barbar', 'foobar'] + ['barbar', 'foobar']]=]) + end) + + it('part 4-4', function() + insert([[ + Tests for compounding. + 4good: word util bork prebork start end wordutil wordutils pro-ok + bork borkbork borkborkbork borkborkborkbork borkborkborkborkbork + tomato tomatotomato startend startword startwordword startwordend + startwordwordend startwordwordwordend prebork preborkbork + preborkborkbork + nouword + bad: wordutilize pro borkborkborkborkborkbork tomatotomatotomato + endstart endend startstart wordend wordstart + preborkprebork preborkpreborkbork + startwordwordwordwordend borkpreborkpreborkbork + utilsbork startnouword + badend + ]]) + test_one(4, 4) + execute('1,/^test 4-4/-1d') + expect([=[ test 4-4 # file: Xtest.utf-8.spl bork @@ -836,8 +808,22 @@ describe("spell checking with 'encoding' set to utf-8", function() utilsbork ['utilbork', 'utils bork', 'util bork'] startnouword - ['start nouword', 'startword', 'startborkword'] + ['start nouword', 'startword', 'startborkword']]=]) + end) + + it('part 5-5', function() + insert([[ + Test affix flags with two characters + 5good: fooa1 fooaé bar prebar barbork prebarbork startprebar + start end startend startmiddleend nouend + bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart + startprobar startnouend + badend + ]]) + test_one(5, 5) + execute('1,/^test 5-5/-1d') + expect([=[ test 5-5 # file: Xtest.utf-8.spl bar @@ -871,8 +857,20 @@ describe("spell checking with 'encoding' set to utf-8", function() startprobar ['startprebar', 'start prebar', 'startbar'] startnouend - ['start nouend', 'startend'] - + ['start nouend', 'startend']]=]) + end) + + it('part 6-6', function() + insert([[ + 6good: meea1 meeaé bar prebar barbork prebarbork leadprebar + lead end leadend leadmiddleend + bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead + leadprobar + badend + ]]) + test_one(6, 6) + execute('1,/^test 6-6/-1d') + expect([=[ test 6-6 # file: Xtest.utf-8.spl bar @@ -903,8 +901,22 @@ describe("spell checking with 'encoding' set to utf-8", function() endlead ['end lead', 'lead', 'end end'] leadprobar - ['leadprebar', 'lead prebar', 'leadbar'] - + ['leadprebar', 'lead prebar', 'leadbar']]=]) + end) + + it('part 7-7', function() + insert([[ + 7good: meea1 meeaé bar prebar barmeat prebarmeat leadprebar + lead tail leadtail leadmiddletail + bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead + leadprobar + badend + ]]) + -- Compound words. + test_one(7, 7) + -- Assert buffer contents. + execute('1,/^test 7-7/-1d') + expect([=[ test 7-7 # file: Xtest.utf-8.spl bar -- cgit From d4fae57a4c6f008cc0281f710d1840e81fca7625 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 25 Jul 2015 13:40:21 +0200 Subject: test59: Fixup incorrectly encoded utf-8 --- .../legacy/059_utf8_spell_checking_spec.lua | 82 +++++++++++----------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/test/functional/legacy/059_utf8_spell_checking_spec.lua b/test/functional/legacy/059_utf8_spell_checking_spec.lua index 52808b0814..4e9ef19a3f 100644 --- a/test/functional/legacy/059_utf8_spell_checking_spec.lua +++ b/test/functional/legacy/059_utf8_spell_checking_spec.lua @@ -539,7 +539,7 @@ describe("spell checking with 'encoding' set to utf-8", function() it('part 1-1', function() insert([[ 1good: wrong OK puts. Test the end - bad: inputs comment ok Ok. test déôl end the + bad: inputs comment ok Ok. test déôl end the badend test2: @@ -547,13 +547,13 @@ describe("spell checking with 'encoding' set to utf-8", function() ]]) test_one(1, 1) execute([[$put =soundfold('goobledygoook')]]) - execute([[$put =soundfold('kóopërÿnôven')]]) + execute([[$put =soundfold('kóopërÿnôven')]]) execute([[$put =soundfold('oeverloos gezwets edale')]]) -- And now with SAL instead of SOFO items; test automatic reloading. os.execute('cp -f Xtest-sal.aff Xtest.aff') execute('mkspell! Xtest Xtest') execute([[$put =soundfold('goobledygoook')]]) - execute([[$put =soundfold('kóopërÿnôven')]]) + execute([[$put =soundfold('kóopërÿnôven')]]) execute([[$put =soundfold('oeverloos gezwets edale')]]) -- Also use an addition file. execute('mkspell! Xtest.utf-8.add.spl Xtest.utf-8.add') @@ -600,7 +600,7 @@ describe("spell checking with 'encoding' set to utf-8", function() # file: Xtest.utf-8.spl Comment deol - déôr + déôr input OK output @@ -627,8 +627,8 @@ describe("spell checking with 'encoding' set to utf-8", function() ['OK', 'Uk', 'Put'] test ['Test', 'testn', 'testen'] - déôl - ['deol', 'déôr', 'test'] + déôl + ['deol', 'déôr', 'test'] end ['put', 'uk', 'test'] the @@ -653,7 +653,7 @@ describe("spell checking with 'encoding' set to utf-8", function() it('part 2-1', function() insert([[ 2good: puts - bad: inputs comment ok Ok end the. test déôl + bad: inputs comment ok Ok end the. test déôl badend ]]) -- Postponed prefixes. @@ -664,7 +664,7 @@ describe("spell checking with 'encoding' set to utf-8", function() # file: Xtest.utf-8.spl Comment deol - déôr + déôr OK put input @@ -695,16 +695,16 @@ describe("spell checking with 'encoding' set to utf-8", function() ['put', 'uk', 'test'] test ['Test', 'testn', 'testen'] - déôl - ['deol', 'déôr', 'test']]=]) + déôl + ['deol', 'déôr', 'test']]=]) end) it('part 3-3', function() insert([[ Test rules for compounding. - 3good: foo mï foobar foofoobar barfoo barbarfoo - bad: bar la foomï barmï mïfoo mïbar mïmï lala mïla lamï foola labar + 3good: foo mï foobar foofoobar barfoo barbarfoo + bad: bar la foomï barmï mïfoo mïbar mïmï lala mïla lamï foola labar badend ]]) test_one(3, 3) @@ -713,30 +713,30 @@ describe("spell checking with 'encoding' set to utf-8", function() test 3-3 # file: Xtest.utf-8.spl foo - mï + mï ------- bad - ['foo', 'mï'] + ['foo', 'mï'] bar ['barfoo', 'foobar', 'foo'] la - ['mï', 'foo'] - foomï - ['foo mï', 'foo', 'foofoo'] - barmï - ['barfoo', 'mï', 'barbar'] - mïfoo - ['mï foo', 'foo', 'foofoo'] - mïbar - ['foobar', 'barbar', 'mï'] - mïmï - ['mï mï', 'mï'] + ['mï', 'foo'] + foomï + ['foo mï', 'foo', 'foofoo'] + barmï + ['barfoo', 'mï', 'barbar'] + mïfoo + ['mï foo', 'foo', 'foofoo'] + mïbar + ['foobar', 'barbar', 'mï'] + mïmï + ['mï mï', 'mï'] lala [] - mïla - ['mï', 'mï mï'] - lamï - ['mï', 'mï mï'] + mïla + ['mï', 'mï mï'] + lamï + ['mï', 'mï mï'] foola ['foo', 'foobar', 'foofoo'] labar @@ -815,7 +815,7 @@ describe("spell checking with 'encoding' set to utf-8", function() insert([[ Test affix flags with two characters - 5good: fooa1 fooaé bar prebar barbork prebarbork startprebar + 5good: fooa1 fooaé bar prebar barbork prebarbork startprebar start end startend startmiddleend nouend bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart startprobar startnouend @@ -830,7 +830,7 @@ describe("spell checking with 'encoding' set to utf-8", function() barbork end fooa1 - fooaé + fooaé nouend prebar prebarbork @@ -839,9 +839,9 @@ describe("spell checking with 'encoding' set to utf-8", function() bad ['bar', 'end', 'fooa1'] foo - ['fooa1', 'fooaé', 'bar'] + ['fooa1', 'fooaé', 'bar'] fooa2 - ['fooa1', 'fooaé', 'bar'] + ['fooa1', 'fooaé', 'bar'] prabar ['prebar', 'bar', 'bar bar'] probarbirk @@ -862,7 +862,7 @@ describe("spell checking with 'encoding' set to utf-8", function() it('part 6-6', function() insert([[ - 6good: meea1 meeaé bar prebar barbork prebarbork leadprebar + 6good: meea1 meeaé bar prebar barbork prebarbork leadprebar lead end leadend leadmiddleend bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead leadprobar @@ -878,16 +878,16 @@ describe("spell checking with 'encoding' set to utf-8", function() end lead meea1 - meeaé + meeaé prebar prebarbork ------- bad ['bar', 'end', 'lead'] mee - ['meea1', 'meeaé', 'bar'] + ['meea1', 'meeaé', 'bar'] meea2 - ['meea1', 'meeaé', 'lead'] + ['meea1', 'meeaé', 'lead'] prabar ['prebar', 'bar', 'leadbar'] probarbirk @@ -906,7 +906,7 @@ describe("spell checking with 'encoding' set to utf-8", function() it('part 7-7', function() insert([[ - 7good: meea1 meeaé bar prebar barmeat prebarmeat leadprebar + 7good: meea1 meeaé bar prebar barmeat prebarmeat leadprebar lead tail leadtail leadmiddletail bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead leadprobar @@ -923,7 +923,7 @@ describe("spell checking with 'encoding' set to utf-8", function() barmeat lead meea1 - meeaé + meeaé prebar prebarmeat tail @@ -931,9 +931,9 @@ describe("spell checking with 'encoding' set to utf-8", function() bad ['bar', 'lead', 'tail'] mee - ['meea1', 'meeaé', 'bar'] + ['meea1', 'meeaé', 'bar'] meea2 - ['meea1', 'meeaé', 'lead'] + ['meea1', 'meeaé', 'lead'] prabar ['prebar', 'bar', 'leadbar'] probarmaat -- cgit From f666b2cb122d40cc5cf625b30c0735a825b2cbfa Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Thu, 20 Aug 2015 14:40:03 +0200 Subject: test59: Make "syntax off" explicit, as default may change with #2675 Helped-By: Felipe Morales --- test/functional/legacy/059_utf8_spell_checking_spec.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/legacy/059_utf8_spell_checking_spec.lua b/test/functional/legacy/059_utf8_spell_checking_spec.lua index 4e9ef19a3f..e93cacf2c5 100644 --- a/test/functional/legacy/059_utf8_spell_checking_spec.lua +++ b/test/functional/legacy/059_utf8_spell_checking_spec.lua @@ -8,6 +8,7 @@ local write_file = helpers.write_file describe("spell checking with 'encoding' set to utf-8", function() setup(function() clear() + execute("syntax off") -- This file should be encoded in ISO8859-1. write_file('Xtest1.aff', 'SET ISO8859-1\n' .. -- cgit From df9d7489ca4a3fcfa977b0e7df9ec3afa0e77f8c Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 26 Jul 2015 22:07:08 +0200 Subject: test59: Delete oldtests 58 and 59 --- src/nvim/testdir/Makefile | 1 - src/nvim/testdir/test58.in | 639 --------------------------------------------- src/nvim/testdir/test58.ok | 283 -------------------- src/nvim/testdir/test59.in | 626 -------------------------------------------- src/nvim/testdir/test59.ok | 270 ------------------- 5 files changed, 1819 deletions(-) delete mode 100644 src/nvim/testdir/test58.in delete mode 100644 src/nvim/testdir/test58.ok delete mode 100644 src/nvim/testdir/test59.in delete mode 100644 src/nvim/testdir/test59.ok diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 6af8893800..8c3e99c624 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -18,7 +18,6 @@ SCRIPTS := test_eval.out \ test42.out test45.out \ test47.out test48.out test49.out \ test52.out test53.out test55.out \ - test58.out test59.out \ test64.out \ test68.out test69.out \ test73.out \ diff --git a/src/nvim/testdir/test58.in b/src/nvim/testdir/test58.in deleted file mode 100644 index cef1cfa1ba..0000000000 --- a/src/nvim/testdir/test58.in +++ /dev/null @@ -1,639 +0,0 @@ -Tests for spell checking. vim: set ft=vim : - -STARTTEST -:so small.vim -:" -:" Don't want to depend on the locale from the environment -:set enc=latin1 -:e! -:" -:" Check using z= in new buffer (crash fixed by patch 7.4a.028). -:set maxmem=512 spell -iasdz=:" -:" -:" Function to test .aff/.dic with list of good and bad words. -:func TestOne(aff, dic) - set spellfile= - $put ='' - $put ='test '. a:aff . '-' . a:dic - " Generate a .spl file from a .dic and .aff file. - exe '1;/^' . a:aff . 'affstart/+1,/^' . a:aff . 'affend/-1w! Xtest.aff' - exe '1;/^' . a:dic . 'dicstart/+1,/^' . a:dic . 'dicend/-1w! Xtest.dic' - mkspell! Xtest Xtest - " use that spell file - set spl=Xtest.latin1.spl spell - " list all valid words - spelldump - %yank - quit - $put - $put ='-------' - " find all bad words and suggestions for them - exe '1;/^' . a:aff . 'good:' - normal 0f:]s - let prevbad = '' - while 1 - let [bad, a] = spellbadword() - if bad == '' || bad == prevbad || bad == 'badend' - break - endif - let prevbad = bad - let lst = spellsuggest(bad, 3) - normal mm - $put =bad - $put =string(lst) - normal `m]s - endwhile -endfunc -:" -:call TestOne('1', '1') -:$put =soundfold('goobledygoook') -:$put =soundfold('koprnven') -:$put =soundfold('oeverloos gezwets edale') -:" -:" -:" and now with SAL instead of SOFO items; test automatic reloading -gg:/^affstart_sal/+1,/^affend_sal/-1w! Xtest.aff -:mkspell! Xtest Xtest -:$put =soundfold('goobledygoook') -:$put =soundfold('koprnven') -:$put =soundfold('oeverloos gezwets edale') -:" -:" also use an addition file -gg:/^addstart/+1,/^addend/-1w! Xtest.latin1.add -:mkspell! Xtest.latin1.add.spl Xtest.latin1.add -:set spellfile=Xtest.latin1.add -/^test2: -]s:let [str, a] = spellbadword() -:$put =str -:set spl=Xtest_us.latin1.spl -/^test2: -]smm:let [str, a] = spellbadword() -:$put =str -`m]s:let [str, a] = spellbadword() -:$put =str -:set spl=Xtest_gb.latin1.spl -/^test2: -]smm:let [str, a] = spellbadword() -:$put =str -`m]s:let [str, a] = spellbadword() -:$put =str -:set spl=Xtest_nz.latin1.spl -/^test2: -]smm:let [str, a] = spellbadword() -:$put =str -`m]s:let [str, a] = spellbadword() -:$put =str -:set spl=Xtest_ca.latin1.spl -/^test2: -]smm:let [str, a] = spellbadword() -:$put =str -`m]s:let [str, a] = spellbadword() -:$put =str -:unlet str a -:" -:" Postponed prefixes -:call TestOne('2', '1') -:" -:" Compound words -:call TestOne('3', '3') -:call TestOne('4', '4') -:call TestOne('5', '5') -:call TestOne('6', '6') -:call TestOne('7', '7') -:" -:" NOSLITSUGS -:call TestOne('8', '8') -:" -:" clean up for valgrind -:delfunc TestOne -:set spl= enc=latin1 -:" -gg:/^test output:/,$wq! test.out -ENDTEST - -1affstart -SET ISO8859-1 -TRY esianrtolcdugmphbyfvkwjkqxz-'ESIANRTOLCDUGMPHBYFVKWJKQXZ - -FOL -LOW -UPP - -SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ޿ -SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep? - -MIDWORD '- - -KEP = -RAR ? -BAD ! - -PFX I N 1 -PFX I 0 in . - -PFX O Y 1 -PFX O 0 out . - -SFX S Y 2 -SFX S 0 s [^s] -SFX S 0 es s - -SFX N N 3 -SFX N 0 en [^n] -SFX N 0 nen n -SFX N 0 n . - -REP 3 -REP g ch -REP ch g -REP svp s.v.p. - -MAP 9 -MAP a -MAP e -MAP i -MAP o -MAP u -MAP n -MAP c -MAP y -MAP s -1affend - -1good: wrong OK puts. Test the end -bad: inputs comment ok Ok. test dl end the -badend - -1dicstart -123456 -test/NO -# comment -wrong -Comment -OK -uk -put/ISO -the end -deol -dr -1dicend - -affstart_sal -SET ISO8859-1 -TRY esianrtolcdugmphbyfvkwjkqxz-'ESIANRTOLCDUGMPHBYFVKWJKQXZ - -FOL -LOW -UPP - -MIDWORD '- - -KEP = -RAR ? -BAD ! - -PFX I N 1 -PFX I 0 in . - -PFX O Y 1 -PFX O 0 out . - -SFX S Y 2 -SFX S 0 s [^s] -SFX S 0 es s - -SFX N N 3 -SFX N 0 en [^n] -SFX N 0 nen n -SFX N 0 n . - -REP 3 -REP g ch -REP ch g -REP svp s.v.p. - -MAP 9 -MAP a -MAP e -MAP i -MAP o -MAP u -MAP n -MAP c -MAP y -MAP s - -SAL AH(AEIOUY)-^ *H -SAL AR(AEIOUY)-^ *R -SAL A(HR)^ * -SAL A^ * -SAL AH(AEIOUY)- H -SAL AR(AEIOUY)- R -SAL A(HR) _ -SAL ^ * -SAL ^ * -SAL BB- _ -SAL B B -SAL CQ- _ -SAL CIA X -SAL CH X -SAL C(EIY)- S -SAL CK K -SAL COUGH^ KF -SAL CC< C -SAL C K -SAL DG(EIY) K -SAL DD- _ -SAL D T -SAL < E -SAL EH(AEIOUY)-^ *H -SAL ER(AEIOUY)-^ *R -SAL E(HR)^ * -SAL ENOUGH^$ *NF -SAL E^ * -SAL EH(AEIOUY)- H -SAL ER(AEIOUY)- R -SAL E(HR) _ -SAL FF- _ -SAL F F -SAL GN^ N -SAL GN$ N -SAL GNS$ NS -SAL GNED$ N -SAL GH(AEIOUY)- K -SAL GH _ -SAL GG9 K -SAL G K -SAL H H -SAL IH(AEIOUY)-^ *H -SAL IR(AEIOUY)-^ *R -SAL I(HR)^ * -SAL I^ * -SAL ING6 N -SAL IH(AEIOUY)- H -SAL IR(AEIOUY)- R -SAL I(HR) _ -SAL J K -SAL KN^ N -SAL KK- _ -SAL K K -SAL LAUGH^ LF -SAL LL- _ -SAL L L -SAL MB$ M -SAL MM M -SAL M M -SAL NN- _ -SAL N N -SAL OH(AEIOUY)-^ *H -SAL OR(AEIOUY)-^ *R -SAL O(HR)^ * -SAL O^ * -SAL OH(AEIOUY)- H -SAL OR(AEIOUY)- R -SAL O(HR) _ -SAL PH F -SAL PN^ N -SAL PP- _ -SAL P P -SAL Q K -SAL RH^ R -SAL ROUGH^ RF -SAL RR- _ -SAL R R -SAL SCH(EOU)- SK -SAL SC(IEY)- S -SAL SH X -SAL SI(AO)- X -SAL SS- _ -SAL S S -SAL TI(AO)- X -SAL TH @ -SAL TCH-- _ -SAL TOUGH^ TF -SAL TT- _ -SAL T T -SAL UH(AEIOUY)-^ *H -SAL UR(AEIOUY)-^ *R -SAL U(HR)^ * -SAL U^ * -SAL UH(AEIOUY)- H -SAL UR(AEIOUY)- R -SAL U(HR) _ -SAL V^ W -SAL V F -SAL WR^ R -SAL WH^ W -SAL W(AEIOU)- W -SAL X^ S -SAL X KS -SAL Y(AEIOU)- Y -SAL ZZ- _ -SAL Z S -affend_sal - -2affstart -SET ISO8859-1 - -FOL -LOW -UPP - -PFXPOSTPONE - -MIDWORD '- - -KEP = -RAR ? -BAD ! - -PFX I N 1 -PFX I 0 in . - -PFX O Y 1 -PFX O 0 out [a-z] - -SFX S Y 2 -SFX S 0 s [^s] -SFX S 0 es s - -SFX N N 3 -SFX N 0 en [^n] -SFX N 0 nen n -SFX N 0 n . - -REP 3 -REP g ch -REP ch g -REP svp s.v.p. - -MAP 9 -MAP a -MAP e -MAP i -MAP o -MAP u -MAP n -MAP c -MAP y -MAP s -2affend - -2good: puts -bad: inputs comment ok Ok end the. test dl -badend - -addstart -/regions=usgbnz -elequint/2 -elekwint/3 -addend - -test2: -elequint test elekwint test elekwent asdf - -Test rules for compounding. - -3affstart -SET ISO8859-1 - -COMPOUNDMIN 3 -COMPOUNDRULE m* -NEEDCOMPOUND x -3affend - -3dicstart -1234 -foo/m -bar/mx -m/m -la/mx -3dicend - -3good: foo m foobar foofoobar barfoo barbarfoo -bad: bar la foom barm mfoo mbar mm lala mla lam foola labar -badend - - -Tests for compounding. - -4affstart -SET ISO8859-1 - -FOL -LOW -UPP - -COMPOUNDRULE m+ -COMPOUNDRULE sm*e -COMPOUNDRULE sm+ -COMPOUNDMIN 3 -COMPOUNDWORDMAX 3 -COMPOUNDFORBIDFLAG t - -COMPOUNDSYLMAX 5 -SYLLABLE aeiouy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui - -MAP 9 -MAP a -MAP e -MAP i -MAP o -MAP u -MAP n -MAP c -MAP y -MAP s - -NEEDAFFIX x - -PFXPOSTPONE - -MIDWORD '- - -SFX q N 1 -SFX q 0 -ok . - -SFX a Y 2 -SFX a 0 s . -SFX a 0 ize/t . - -PFX p N 1 -PFX p 0 pre . - -PFX P N 1 -PFX P 0 nou . -4affend - -4dicstart -1234 -word/mP -util/am -pro/xq -tomato/m -bork/mp -start/s -end/e -4dicend - -4good: word util bork prebork start end wordutil wordutils pro-ok - bork borkbork borkborkbork borkborkborkbork borkborkborkborkbork - tomato tomatotomato startend startword startwordword startwordend - startwordwordend startwordwordwordend prebork preborkbork - preborkborkbork - nouword -bad: wordutilize pro borkborkborkborkborkbork tomatotomatotomato - endstart endend startstart wordend wordstart - preborkprebork preborkpreborkbork - startwordwordwordwordend borkpreborkpreborkbork - utilsbork startnouword -badend - -Test affix flags with two characters - -5affstart -SET ISO8859-1 - -FLAG long - -NEEDAFFIX !! - -COMPOUNDRULE ssmm*ee - -NEEDCOMPOUND xx -COMPOUNDPERMITFLAG pp - -SFX 13 Y 1 -SFX 13 0 bork . - -SFX a1 Y 1 -SFX a1 0 a1 . - -SFX a Y 1 -SFX a 0 a . - -PFX zz Y 1 -PFX zz 0 pre/pp . - -PFX yy Y 1 -PFX yy 0 nou . -5affend - -5dicstart -1234 -foo/a1a!! -bar/zz13ee -start/ss -end/eeyy -middle/mmxx -5dicend - -5good: fooa1 fooa bar prebar barbork prebarbork startprebar - start end startend startmiddleend nouend -bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart - startprobar startnouend -badend - -6affstart -SET ISO8859-1 - -FLAG caplong - -NEEDAFFIX A! - -COMPOUNDRULE sMm*Ee - -NEEDCOMPOUND Xx - -COMPOUNDPERMITFLAG p - -SFX N3 Y 1 -SFX N3 0 bork . - -SFX A1 Y 1 -SFX A1 0 a1 . - -SFX A Y 1 -SFX A 0 a . - -PFX Zz Y 1 -PFX Zz 0 pre/p . -6affend - -6dicstart -1234 -mee/A1AA! -bar/ZzN3Ee -lead/s -end/Ee -middle/MmXx -6dicend - -6good: meea1 meea bar prebar barbork prebarbork leadprebar - lead end leadend leadmiddleend -bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead - leadprobar -badend - -7affstart -SET ISO8859-1 - -FLAG num - -NEEDAFFIX 9999 - -COMPOUNDRULE 2,77*123 - -NEEDCOMPOUND 1 -COMPOUNDPERMITFLAG 432 - -SFX 61003 Y 1 -SFX 61003 0 meat . - -SFX 391 Y 1 -SFX 391 0 a1 . - -SFX 111 Y 1 -SFX 111 0 a . - -PFX 17 Y 1 -PFX 17 0 pre/432 . -7affend - -7dicstart -1234 -mee/391,111,9999 -bar/17,61003,123 -lead/2 -tail/123 -middle/77,1 -7dicend - -7good: meea1 meea bar prebar barmeat prebarmeat leadprebar - lead tail leadtail leadmiddletail -bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead - leadprobar -badend - -Test NOSLITSUGS - -8affstart -SET ISO8859-1 - -NOSPLITSUGS -8affend - -8dicstart -1234 -foo -bar -faabar -8dicend - -8good: foo bar faabar -bad: foobar barfoo -badend - - -test output: diff --git a/src/nvim/testdir/test58.ok b/src/nvim/testdir/test58.ok deleted file mode 100644 index ce05c73322..0000000000 --- a/src/nvim/testdir/test58.ok +++ /dev/null @@ -1,283 +0,0 @@ -test output: - -test 1-1 -# file: Xtest.latin1.spl -Comment -deol -dr -input -OK -output -outputs -outtest -put -puts -test -testen -testn -the end -uk -wrong -------- -bad -['put', 'uk', 'OK'] -inputs -['input', 'puts', 'outputs'] -comment -['Comment', 'outtest', 'the end'] -ok -['OK', 'uk', 'put'] -Ok -['OK', 'Uk', 'Put'] -test -['Test', 'testn', 'testen'] -dl -['deol', 'dr', 'test'] -end -['put', 'uk', 'test'] -the -['put', 'uk', 'test'] -gebletegek -kepereneven -everles gesvets etele -kbltykk -kprnfn -*fls kswts tl -elekwent -elequint -elekwint -elekwint -elekwent -elequint -elekwent -elequint -elekwint - -test 2-1 -# file: Xtest.latin1.spl -Comment -deol -dr -OK -put -input -output -puts -outputs -test -outtest -testen -testn -the end -uk -wrong -------- -bad -['put', 'uk', 'OK'] -inputs -['input', 'puts', 'outputs'] -comment -['Comment'] -ok -['OK', 'uk', 'put'] -Ok -['OK', 'Uk', 'Put'] -end -['put', 'uk', 'deol'] -the -['put', 'uk', 'test'] -test -['Test', 'testn', 'testen'] -dl -['deol', 'dr', 'test'] - -test 3-3 -# file: Xtest.latin1.spl -foo -m -------- -bad -['foo', 'm'] -bar -['barfoo', 'foobar', 'foo'] -la -['m', 'foo'] -foom -['foo m', 'foo', 'foofoo'] -barm -['barfoo', 'm', 'barbar'] -mfoo -['m foo', 'foo', 'foofoo'] -mbar -['foobar', 'barbar', 'm'] -mm -['m m', 'm'] -lala -[] -mla -['m', 'm m'] -lam -['m', 'm m'] -foola -['foo', 'foobar', 'foofoo'] -labar -['barbar', 'foobar'] - -test 4-4 -# file: Xtest.latin1.spl -bork -prebork -end -pro-ok -start -tomato -util -utilize -utils -word -nouword -------- -bad -['end', 'bork', 'word'] -wordutilize -['word utilize', 'wordutils', 'wordutil'] -pro -['bork', 'word', 'end'] -borkborkborkborkborkbork -['bork borkborkborkborkbork', 'borkbork borkborkborkbork', 'borkborkbork borkborkbork'] -tomatotomatotomato -['tomato tomatotomato', 'tomatotomato tomato', 'tomato tomato tomato'] -endstart -['end start', 'start'] -endend -['end end', 'end'] -startstart -['start start'] -wordend -['word end', 'word', 'wordword'] -wordstart -['word start', 'bork start'] -preborkprebork -['prebork prebork', 'preborkbork', 'preborkborkbork'] -preborkpreborkbork -['prebork preborkbork', 'preborkborkbork', 'preborkborkborkbork'] -startwordwordwordwordend -['startwordwordwordword end', 'startwordwordwordword', 'start wordwordwordword end'] -borkpreborkpreborkbork -['bork preborkpreborkbork', 'bork prebork preborkbork', 'bork preborkprebork bork'] -utilsbork -['utilbork', 'utils bork', 'util bork'] -startnouword -['start nouword', 'startword', 'startborkword'] - -test 5-5 -# file: Xtest.latin1.spl -bar -barbork -end -fooa1 -fooa -nouend -prebar -prebarbork -start -------- -bad -['bar', 'end', 'fooa1'] -foo -['fooa1', 'fooa', 'bar'] -fooa2 -['fooa1', 'fooa', 'bar'] -prabar -['prebar', 'bar', 'bar bar'] -probarbirk -['prebarbork'] -middle -[] -startmiddle -['startmiddleend', 'startmiddlebar'] -middleend -[] -endstart -['end start', 'start'] -startprobar -['startprebar', 'start prebar', 'startbar'] -startnouend -['start nouend', 'startend'] - -test 6-6 -# file: Xtest.latin1.spl -bar -barbork -end -lead -meea1 -meea -prebar -prebarbork -------- -bad -['bar', 'end', 'lead'] -mee -['meea1', 'meea', 'bar'] -meea2 -['meea1', 'meea', 'lead'] -prabar -['prebar', 'bar', 'leadbar'] -probarbirk -['prebarbork'] -middle -[] -leadmiddle -['leadmiddleend', 'leadmiddlebar'] -middleend -[] -endlead -['end lead', 'lead', 'end end'] -leadprobar -['leadprebar', 'lead prebar', 'leadbar'] - -test 7-7 -# file: Xtest.latin1.spl -bar -barmeat -lead -meea1 -meea -prebar -prebarmeat -tail -------- -bad -['bar', 'lead', 'tail'] -mee -['meea1', 'meea', 'bar'] -meea2 -['meea1', 'meea', 'lead'] -prabar -['prebar', 'bar', 'leadbar'] -probarmaat -['prebarmeat'] -middle -[] -leadmiddle -['leadmiddlebar'] -middletail -[] -taillead -['tail lead', 'tail'] -leadprobar -['leadprebar', 'lead prebar', 'leadbar'] - -test 8-8 -# file: Xtest.latin1.spl -bar -faabar -foo -------- -bad -['bar', 'foo'] -foobar -['faabar', 'foo bar', 'bar'] -barfoo -['bar foo', 'bar', 'foo'] diff --git a/src/nvim/testdir/test59.in b/src/nvim/testdir/test59.in deleted file mode 100644 index dcdb62b283..0000000000 --- a/src/nvim/testdir/test59.in +++ /dev/null @@ -1,626 +0,0 @@ -Tests for spell checking with 'encoding' set to "utf-8". vim: set ft=vim : - -STARTTEST -:so small.vim -:so mbyte.vim -:" -:" Don't want to depend on the locale from the environment. The .aff and .dic -:" text is in latin1, the test text is utf-8. -:set enc=latin1 -:e! -:set enc=utf-8 -:set fenc= -:" -:" Function to test .aff/.dic with list of good and bad words. -:func TestOne(aff, dic) - set spellfile= - $put ='' - $put ='test '. a:aff . '-' . a:dic - " Generate a .spl file from a .dic and .aff file. - exe '1;/^' . a:aff . 'affstart/+1,/^' . a:aff . 'affend/-1w! Xtest.aff' - exe '1;/^' . a:dic . 'dicstart/+1,/^' . a:dic . 'dicend/-1w! Xtest.dic' - mkspell! Xtest Xtest - " use that spell file - set spl=Xtest.utf-8.spl spell - " list all valid words - spelldump - %yank - quit - $put - $put ='-------' - " find all bad words and suggestions for them - exe '1;/^' . a:aff . 'good:' - normal 0f:]s - let prevbad = '' - while 1 - let [bad, a] = spellbadword() - if bad == '' || bad == prevbad || bad == 'badend' - break - endif - let prevbad = bad - let lst = spellsuggest(bad, 3) - normal mm - $put =bad - $put =string(lst) - normal `m]s - endwhile -endfunc -:" -:call TestOne('1', '1') -:$put =soundfold('goobledygoook') -:$put =soundfold('kóopërÿnôven') -:$put =soundfold('oeverloos gezwets edale') -:" -:" -:" and now with SAL instead of SOFO items; test automatic reloading -gg:/^affstart_sal/+1,/^affend_sal/-1w! Xtest.aff -:mkspell! Xtest Xtest -:$put =soundfold('goobledygoook') -:$put =soundfold('kóopërÿnôven') -:$put =soundfold('oeverloos gezwets edale') -:" -:" also use an addition file -gg:/^addstart/+1,/^addend/-1w! Xtest.utf-8.add -:mkspell! Xtest.utf-8.add.spl Xtest.utf-8.add -:set spellfile=Xtest.utf-8.add -/^test2: -]s:let [str, a] = spellbadword() -:$put =str -:set spl=Xtest_us.utf-8.spl -/^test2: -]smm:let [str, a] = spellbadword() -:$put =str -`m]s:let [str, a] = spellbadword() -:$put =str -:set spl=Xtest_gb.utf-8.spl -/^test2: -]smm:let [str, a] = spellbadword() -:$put =str -`m]s:let [str, a] = spellbadword() -:$put =str -:set spl=Xtest_nz.utf-8.spl -/^test2: -]smm:let [str, a] = spellbadword() -:$put =str -`m]s:let [str, a] = spellbadword() -:$put =str -:set spl=Xtest_ca.utf-8.spl -/^test2: -]smm:let [str, a] = spellbadword() -:$put =str -`m]s:let [str, a] = spellbadword() -:$put =str -:unlet str a -:" -:" Postponed prefixes -:call TestOne('2', '1') -:" -:" Compound words -:call TestOne('3', '3') -:call TestOne('4', '4') -:call TestOne('5', '5') -:call TestOne('6', '6') -:call TestOne('7', '7') -:" -:" clean up for valgrind -:delfunc TestOne -:set spl= enc=latin1 -:" -gg:/^test output:/,$wq! test.out -ENDTEST - -1affstart -SET ISO8859-1 -TRY esianrtolcdugmphbyfvkwjkqxz-'ESIANRTOLCDUGMPHBYFVKWJKQXZ - -FOL -LOW -UPP - -SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ޿ -SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep? - -MIDWORD '- - -KEP = -RAR ? -BAD ! - -#NOSPLITSUGS - -PFX I N 1 -PFX I 0 in . - -PFX O Y 1 -PFX O 0 out . - -SFX S Y 2 -SFX S 0 s [^s] -SFX S 0 es s - -SFX N N 3 -SFX N 0 en [^n] -SFX N 0 nen n -SFX N 0 n . - -REP 3 -REP g ch -REP ch g -REP svp s.v.p. - -MAP 9 -MAP a -MAP e -MAP i -MAP o -MAP u -MAP n -MAP c -MAP y -MAP s -1affend - -affstart_sal -SET ISO8859-1 -TRY esianrtolcdugmphbyfvkwjkqxz-'ESIANRTOLCDUGMPHBYFVKWJKQXZ - -FOL -LOW -UPP - -MIDWORD '- - -KEP = -RAR ? -BAD ! - -#NOSPLITSUGS - -PFX I N 1 -PFX I 0 in . - -PFX O Y 1 -PFX O 0 out . - -SFX S Y 2 -SFX S 0 s [^s] -SFX S 0 es s - -SFX N N 3 -SFX N 0 en [^n] -SFX N 0 nen n -SFX N 0 n . - -REP 3 -REP g ch -REP ch g -REP svp s.v.p. - -MAP 9 -MAP a -MAP e -MAP i -MAP o -MAP u -MAP n -MAP c -MAP y -MAP s - -SAL AH(AEIOUY)-^ *H -SAL AR(AEIOUY)-^ *R -SAL A(HR)^ * -SAL A^ * -SAL AH(AEIOUY)- H -SAL AR(AEIOUY)- R -SAL A(HR) _ -SAL ^ * -SAL ^ * -SAL BB- _ -SAL B B -SAL CQ- _ -SAL CIA X -SAL CH X -SAL C(EIY)- S -SAL CK K -SAL COUGH^ KF -SAL CC< C -SAL C K -SAL DG(EIY) K -SAL DD- _ -SAL D T -SAL < E -SAL EH(AEIOUY)-^ *H -SAL ER(AEIOUY)-^ *R -SAL E(HR)^ * -SAL ENOUGH^$ *NF -SAL E^ * -SAL EH(AEIOUY)- H -SAL ER(AEIOUY)- R -SAL E(HR) _ -SAL FF- _ -SAL F F -SAL GN^ N -SAL GN$ N -SAL GNS$ NS -SAL GNED$ N -SAL GH(AEIOUY)- K -SAL GH _ -SAL GG9 K -SAL G K -SAL H H -SAL IH(AEIOUY)-^ *H -SAL IR(AEIOUY)-^ *R -SAL I(HR)^ * -SAL I^ * -SAL ING6 N -SAL IH(AEIOUY)- H -SAL IR(AEIOUY)- R -SAL I(HR) _ -SAL J K -SAL KN^ N -SAL KK- _ -SAL K K -SAL LAUGH^ LF -SAL LL- _ -SAL L L -SAL MB$ M -SAL MM M -SAL M M -SAL NN- _ -SAL N N -SAL OH(AEIOUY)-^ *H -SAL OR(AEIOUY)-^ *R -SAL O(HR)^ * -SAL O^ * -SAL OH(AEIOUY)- H -SAL OR(AEIOUY)- R -SAL O(HR) _ -SAL PH F -SAL PN^ N -SAL PP- _ -SAL P P -SAL Q K -SAL RH^ R -SAL ROUGH^ RF -SAL RR- _ -SAL R R -SAL SCH(EOU)- SK -SAL SC(IEY)- S -SAL SH X -SAL SI(AO)- X -SAL SS- _ -SAL S S -SAL TI(AO)- X -SAL TH @ -SAL TCH-- _ -SAL TOUGH^ TF -SAL TT- _ -SAL T T -SAL UH(AEIOUY)-^ *H -SAL UR(AEIOUY)-^ *R -SAL U(HR)^ * -SAL U^ * -SAL UH(AEIOUY)- H -SAL UR(AEIOUY)- R -SAL U(HR) _ -SAL V^ W -SAL V F -SAL WR^ R -SAL WH^ W -SAL W(AEIOU)- W -SAL X^ S -SAL X KS -SAL Y(AEIOU)- Y -SAL ZZ- _ -SAL Z S -affend_sal - -2affstart -SET ISO8859-1 - -FOL -LOW -UPP - -PFXPOSTPONE - -MIDWORD '- - -KEP = -RAR ? -BAD ! - -#NOSPLITSUGS - -PFX I N 1 -PFX I 0 in . - -PFX O Y 1 -PFX O 0 out [a-z] - -SFX S Y 2 -SFX S 0 s [^s] -SFX S 0 es s - -SFX N N 3 -SFX N 0 en [^n] -SFX N 0 nen n -SFX N 0 n . - -REP 3 -REP g ch -REP ch g -REP svp s.v.p. - -MAP 9 -MAP a -MAP e -MAP i -MAP o -MAP u -MAP n -MAP c -MAP y -MAP s -2affend - -1dicstart -123456 -test/NO -# comment -wrong -Comment -OK -uk -put/ISO -the end -deol -dr -1dicend - -addstart -/regions=usgbnz -elequint/2 -elekwint/3 -addend - -1good: wrong OK puts. Test the end -bad: inputs comment ok Ok. test déôl end the -badend - -2good: puts -bad: inputs comment ok Ok end the. test déôl -badend - -Test rules for compounding. - -3affstart -SET ISO8859-1 - -COMPOUNDMIN 3 -COMPOUNDRULE m* -NEEDCOMPOUND x -3affend - -3dicstart -1234 -foo/m -bar/mx -m/m -la/mx -3dicend - -3good: foo mï foobar foofoobar barfoo barbarfoo -bad: bar la foomï barmï mïfoo mïbar mïmï lala mïla lamï foola labar -badend - - -Tests for compounding. - -4affstart -SET ISO8859-1 - -FOL -LOW -UPP - -COMPOUNDRULE m+ -COMPOUNDRULE sm*e -COMPOUNDRULE sm+ -COMPOUNDMIN 3 -COMPOUNDWORDMAX 3 -COMPOUNDFORBIDFLAG t - -COMPOUNDSYLMAX 5 -SYLLABLE aeiouy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui - -MAP 9 -MAP a -MAP e -MAP i -MAP o -MAP u -MAP n -MAP c -MAP y -MAP s - -NEEDAFFIX x - -PFXPOSTPONE - -MIDWORD '- - -SFX q N 1 -SFX q 0 -ok . - -SFX a Y 2 -SFX a 0 s . -SFX a 0 ize/t . - -PFX p N 1 -PFX p 0 pre . - -PFX P N 1 -PFX P 0 nou . -4affend - -4dicstart -1234 -word/mP -util/am -pro/xq -tomato/m -bork/mp -start/s -end/e -4dicend - -4good: word util bork prebork start end wordutil wordutils pro-ok - bork borkbork borkborkbork borkborkborkbork borkborkborkborkbork - tomato tomatotomato startend startword startwordword startwordend - startwordwordend startwordwordwordend prebork preborkbork - preborkborkbork - nouword -bad: wordutilize pro borkborkborkborkborkbork tomatotomatotomato - endstart endend startstart wordend wordstart - preborkprebork preborkpreborkbork - startwordwordwordwordend borkpreborkpreborkbork - utilsbork startnouword -badend - -test2: -elequint test elekwint test elekwent asdf - -Test affix flags with two characters - -5affstart -SET ISO8859-1 - -FLAG long - -NEEDAFFIX !! - -COMPOUNDRULE ssmm*ee - -NEEDCOMPOUND xx -COMPOUNDPERMITFLAG pp - -SFX 13 Y 1 -SFX 13 0 bork . - -SFX a1 Y 1 -SFX a1 0 a1 . - -SFX a Y 1 -SFX a 0 a . - -PFX zz Y 1 -PFX zz 0 pre/pp . - -PFX yy Y 1 -PFX yy 0 nou . -5affend - -5dicstart -1234 -foo/a1a!! -bar/zz13ee -start/ss -end/eeyy -middle/mmxx -5dicend - -5good: fooa1 fooaé bar prebar barbork prebarbork startprebar - start end startend startmiddleend nouend -bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart - startprobar startnouend -badend - -6affstart -SET ISO8859-1 - -FLAG caplong - -NEEDAFFIX A! - -COMPOUNDRULE sMm*Ee - -NEEDCOMPOUND Xx - -COMPOUNDPERMITFLAG p - -SFX N3 Y 1 -SFX N3 0 bork . - -SFX A1 Y 1 -SFX A1 0 a1 . - -SFX A Y 1 -SFX A 0 a . - -PFX Zz Y 1 -PFX Zz 0 pre/p . -6affend - -6dicstart -1234 -mee/A1AA! -bar/ZzN3Ee -lead/s -end/Ee -middle/MmXx -6dicend - -6good: meea1 meeaé bar prebar barbork prebarbork leadprebar - lead end leadend leadmiddleend -bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead - leadprobar -badend - -7affstart -SET ISO8859-1 - -FOL -LOW -UPP - -FLAG num - -NEEDAFFIX 9999 - -COMPOUNDRULE 2,77*123 - -NEEDCOMPOUND 1 -COMPOUNDPERMITFLAG 432 - -SFX 61003 Y 1 -SFX 61003 0 meat . - -SFX 391 Y 1 -SFX 391 0 a1 . - -SFX 111 Y 1 -SFX 111 0 a . - -PFX 17 Y 1 -PFX 17 0 pre/432 . -7affend - -7dicstart -1234 -mee/391,111,9999 -bar/17,61003,123 -lead/2 -tail/123 -middle/77,1 -7dicend - -7good: meea1 meeaé bar prebar barmeat prebarmeat leadprebar - lead tail leadtail leadmiddletail -bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead - leadprobar -badend - -test output: diff --git a/src/nvim/testdir/test59.ok b/src/nvim/testdir/test59.ok deleted file mode 100644 index 931cdd9654..0000000000 --- a/src/nvim/testdir/test59.ok +++ /dev/null @@ -1,270 +0,0 @@ -test output: - -test 1-1 -# file: Xtest.utf-8.spl -Comment -deol -déôr -input -OK -output -outputs -outtest -put -puts -test -testen -testn -the end -uk -wrong -------- -bad -['put', 'uk', 'OK'] -inputs -['input', 'puts', 'outputs'] -comment -['Comment', 'outtest', 'the end'] -ok -['OK', 'uk', 'put'] -Ok -['OK', 'Uk', 'Put'] -test -['Test', 'testn', 'testen'] -déôl -['deol', 'déôr', 'test'] -end -['put', 'uk', 'test'] -the -['put', 'uk', 'test'] -gebletegek -kepereneven -everles gesvets etele -kbltykk -kprnfn -*fls kswts tl -elekwent -elequint -elekwint -elekwint -elekwent -elequint -elekwent -elequint -elekwint - -test 2-1 -# file: Xtest.utf-8.spl -Comment -deol -déôr -OK -put -input -output -puts -outputs -test -outtest -testen -testn -the end -uk -wrong -------- -bad -['put', 'uk', 'OK'] -inputs -['input', 'puts', 'outputs'] -comment -['Comment'] -ok -['OK', 'uk', 'put'] -Ok -['OK', 'Uk', 'Put'] -end -['put', 'uk', 'deol'] -the -['put', 'uk', 'test'] -test -['Test', 'testn', 'testen'] -déôl -['deol', 'déôr', 'test'] - -test 3-3 -# file: Xtest.utf-8.spl -foo -mï -------- -bad -['foo', 'mï'] -bar -['barfoo', 'foobar', 'foo'] -la -['mï', 'foo'] -foomï -['foo mï', 'foo', 'foofoo'] -barmï -['barfoo', 'mï', 'barbar'] -mïfoo -['mï foo', 'foo', 'foofoo'] -mïbar -['foobar', 'barbar', 'mï'] -mïmï -['mï mï', 'mï'] -lala -[] -mïla -['mï', 'mï mï'] -lamï -['mï', 'mï mï'] -foola -['foo', 'foobar', 'foofoo'] -labar -['barbar', 'foobar'] - -test 4-4 -# file: Xtest.utf-8.spl -bork -prebork -end -pro-ok -start -tomato -util -utilize -utils -word -nouword -------- -bad -['end', 'bork', 'word'] -wordutilize -['word utilize', 'wordutils', 'wordutil'] -pro -['bork', 'word', 'end'] -borkborkborkborkborkbork -['bork borkborkborkborkbork', 'borkbork borkborkborkbork', 'borkborkbork borkborkbork'] -tomatotomatotomato -['tomato tomatotomato', 'tomatotomato tomato', 'tomato tomato tomato'] -endstart -['end start', 'start'] -endend -['end end', 'end'] -startstart -['start start'] -wordend -['word end', 'word', 'wordword'] -wordstart -['word start', 'bork start'] -preborkprebork -['prebork prebork', 'preborkbork', 'preborkborkbork'] -preborkpreborkbork -['prebork preborkbork', 'preborkborkbork', 'preborkborkborkbork'] -startwordwordwordwordend -['startwordwordwordword end', 'startwordwordwordword', 'start wordwordwordword end'] -borkpreborkpreborkbork -['bork preborkpreborkbork', 'bork prebork preborkbork', 'bork preborkprebork bork'] -utilsbork -['utilbork', 'utils bork', 'util bork'] -startnouword -['start nouword', 'startword', 'startborkword'] - -test 5-5 -# file: Xtest.utf-8.spl -bar -barbork -end -fooa1 -fooaé -nouend -prebar -prebarbork -start -------- -bad -['bar', 'end', 'fooa1'] -foo -['fooa1', 'fooaé', 'bar'] -fooa2 -['fooa1', 'fooaé', 'bar'] -prabar -['prebar', 'bar', 'bar bar'] -probarbirk -['prebarbork'] -middle -[] -startmiddle -['startmiddleend', 'startmiddlebar'] -middleend -[] -endstart -['end start', 'start'] -startprobar -['startprebar', 'start prebar', 'startbar'] -startnouend -['start nouend', 'startend'] - -test 6-6 -# file: Xtest.utf-8.spl -bar -barbork -end -lead -meea1 -meeaé -prebar -prebarbork -------- -bad -['bar', 'end', 'lead'] -mee -['meea1', 'meeaé', 'bar'] -meea2 -['meea1', 'meeaé', 'lead'] -prabar -['prebar', 'bar', 'leadbar'] -probarbirk -['prebarbork'] -middle -[] -leadmiddle -['leadmiddleend', 'leadmiddlebar'] -middleend -[] -endlead -['end lead', 'lead', 'end end'] -leadprobar -['leadprebar', 'lead prebar', 'leadbar'] - -test 7-7 -# file: Xtest.utf-8.spl -bar -barmeat -lead -meea1 -meeaé -prebar -prebarmeat -tail -------- -bad -['bar', 'lead', 'tail'] -mee -['meea1', 'meeaé', 'bar'] -meea2 -['meea1', 'meeaé', 'lead'] -prabar -['prebar', 'bar', 'leadbar'] -probarmaat -['prebarmeat'] -middle -[] -leadmiddle -['leadmiddlebar'] -middletail -[] -taillead -['tail lead', 'tail'] -leadprobar -['leadprebar', 'lead prebar', 'leadbar'] -- cgit From 2b6d1546ecfb24a6cf7ef970bcea3b9a288ad5a5 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 23 Aug 2015 14:16:46 +0200 Subject: test59: Store all text as utf-8 and convert when needed --- test/functional/helpers.lua | 5 + .../legacy/059_utf8_spell_checking_spec.lua | 860 ++++++++++----------- 2 files changed, 430 insertions(+), 435 deletions(-) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 799b57494b..f228f6290c 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -129,6 +129,10 @@ local function nvim_eval(expr) return request('vim_eval', expr) end +local function nvim_call(name, ...) + return request('vim_call_function', name, {...}) +end + local function nvim_feed(input) while #input > 0 do local written = request('vim_input', input) @@ -321,6 +325,7 @@ return { feed = feed, execute = execute, eval = nvim_eval, + call = nvim_call, command = nvim_command, request = request, next_message = next_message, diff --git a/test/functional/legacy/059_utf8_spell_checking_spec.lua b/test/functional/legacy/059_utf8_spell_checking_spec.lua index e93cacf2c5..5794e875a0 100644 --- a/test/functional/legacy/059_utf8_spell_checking_spec.lua +++ b/test/functional/legacy/059_utf8_spell_checking_spec.lua @@ -3,202 +3,190 @@ local helpers = require('test.functional.helpers') local feed, insert, source = helpers.feed, helpers.insert, helpers.source local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect -local write_file = helpers.write_file +local write_file, call = helpers.write_file, helpers.call + +local function write_latin1(name, text) + text = call('iconv', text, 'utf-8', 'latin-1') + write_file(name, text) +end describe("spell checking with 'encoding' set to utf-8", function() setup(function() clear() execute("syntax off") - -- This file should be encoded in ISO8859-1. - write_file('Xtest1.aff', - 'SET ISO8859-1\n' .. - 'TRY esianrtolcdugmphbyfvkwjkqxz-\xeb\xe9\xe8\xea\xef\xee\xe4\xe0' .. - '\xe2\xf6\xfc\xfb\'ESIANRTOLCDUGMPHBYFVKWJKQXZ\n' .. - '\n' .. - 'FOL \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. - '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. - '\xff\n' .. - 'LOW \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. - '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. - '\xff\n' .. - 'UPP \xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce' .. - '\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' .. - '\xff\n' .. - '\n' .. - 'SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\xe0' .. - '\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0' .. - '\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf\xff\xc0' .. - '\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0' .. - '\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xbf\n' .. - 'SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeee' .. - 'eceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep?\n' .. - '\n' .. - 'MIDWORD\t\'-\n' .. - '\n' .. - 'KEP =\n' .. - 'RAR ?\n' .. - 'BAD !\n' .. - '\n' .. - '#NOSPLITSUGS\n' .. - '\n' .. - 'PFX I N 1\n' .. - 'PFX I 0 in .\n' .. - '\n' .. - 'PFX O Y 1\n' .. - 'PFX O 0 out .\n' .. - '\n' .. - 'SFX S Y 2\n' .. - 'SFX S 0 s [^s]\n' .. - 'SFX S 0 es s\n' .. - '\n' .. - 'SFX N N 3\n' .. - 'SFX N 0 en [^n]\n' .. - 'SFX N 0 nen n\n' .. - 'SFX N 0 n .\n' .. - '\n' .. - 'REP 3\n' .. - 'REP g ch\n' .. - 'REP ch g\n' .. - 'REP svp s.v.p.\n' .. - '\n' .. - 'MAP 9\n' .. - 'MAP a\xe0\xe1\xe2\xe3\xe4\xe5\n' .. - 'MAP e\xe8\xe9\xea\xeb\n' .. - 'MAP i\xec\xed\xee\xef\n' .. - 'MAP o\xf2\xf3\xf4\xf5\xf6\n' .. - 'MAP u\xf9\xfa\xfb\xfc\n' .. - 'MAP n\xf1\n' .. - 'MAP c\xe7\n' .. - 'MAP y\xff\xfd\n' .. - 'MAP s\xdf\n') - write_file('Xtest1.dic', - '123456\n' .. - 'test/NO\n' .. - '# comment\n' .. - 'wrong\n' .. - 'Comment\n' .. - 'OK\n' .. - 'uk\n' .. - 'put/ISO\n' .. - 'the end\n' .. - 'deol\n' .. - '\x64\xe9\xf4\x72\n') - write_file('Xtest2.aff', - 'SET ISO8859-1\n' .. - '\n' .. - 'FOL \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. - '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. - '\xff\n' .. - 'LOW \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. - '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. - '\xff\n' .. - 'UPP \xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce' .. - '\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' .. - '\xff\n' .. - '\n' .. - 'PFXPOSTPONE\n' .. - '\n' .. - 'MIDWORD\t\'-\n' .. - '\n' .. - 'KEP =\n' .. - 'RAR ?\n' .. - 'BAD !\n' .. - '\n' .. - '#NOSPLITSUGS\n' .. - '\n' .. - 'PFX I N 1\n' .. - 'PFX I 0 in .\n' .. - '\n' .. - 'PFX O Y 1\n' .. - 'PFX O 0 out [a-z]\n' .. - '\n' .. - 'SFX S Y 2\n' .. - 'SFX S 0 s [^s]\n' .. - 'SFX S 0 es s\n' .. - '\n' .. - 'SFX N N 3\n' .. - 'SFX N 0 en [^n]\n' .. - 'SFX N 0 nen n\n' .. - 'SFX N 0 n .\n' .. - '\n' .. - 'REP 3\n' .. - 'REP g ch\n' .. - 'REP ch g\n' .. - 'REP svp s.v.p.\n' .. - '\n' .. - 'MAP 9\n' .. - 'MAP a\xe0\xe1\xe2\xe3\xe4\xe5\n' .. - 'MAP e\xe8\xe9\xea\xeb\n' .. - 'MAP i\xec\xed\xee\xef\n' .. - 'MAP o\xf2\xf3\xf4\xf5\xf6\n' .. - 'MAP u\xf9\xfa\xfb\xfc\n' .. - 'MAP n\xf1\n' .. - 'MAP c\xe7\n' .. - 'MAP y\xff\xfd\n' .. - 'MAP s\xdf\n') - write_file('Xtest3.aff', [[ + write_latin1('Xtest1.aff',[[ + SET ISO8859-1 + TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ + + FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ + + SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ¿ + SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep? + + MIDWORD '- + + KEP = + RAR ? + BAD ! + + #NOSPLITSUGS + + PFX I N 1 + PFX I 0 in . + + PFX O Y 1 + PFX O 0 out . + + SFX S Y 2 + SFX S 0 s [^s] + SFX S 0 es s + + SFX N N 3 + SFX N 0 en [^n] + SFX N 0 nen n + SFX N 0 n . + + REP 3 + REP g ch + REP ch g + REP svp s.v.p. + + MAP 9 + MAP aàáâãäå + MAP eèéêë + MAP iìíîï + MAP oòóôõö + MAP uùúûü + MAP nñ + MAP cç + MAP yÿý + MAP sß + ]]) + write_latin1('Xtest1.dic', [[ + 123456 + test/NO + # comment + wrong + Comment + OK + uk + put/ISO + the end + deol + déôr + ]]) + write_latin1('Xtest2.aff', [[ + SET ISO8859-1 + + FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ + + PFXPOSTPONE + + MIDWORD '- + + KEP = + RAR ? + BAD ! + + #NOSPLITSUGS + + PFX I N 1 + PFX I 0 in . + + PFX O Y 1 + PFX O 0 out [a-z] + + SFX S Y 2 + SFX S 0 s [^s] + SFX S 0 es s + + SFX N N 3 + SFX N 0 en [^n] + SFX N 0 nen n + SFX N 0 n . + + REP 3 + REP g ch + REP ch g + REP svp s.v.p. + + MAP 9 + MAP aàáâãäå + MAP eèéêë + MAP iìíîï + MAP oòóôõö + MAP uùúûü + MAP nñ + MAP cç + MAP yÿý + MAP sß + ]]) + write_latin1('Xtest3.aff', [[ SET ISO8859-1 COMPOUNDMIN 3 COMPOUNDRULE m* NEEDCOMPOUND x ]]) - write_file('Xtest3.dic', - '1234\nfoo/m\nbar/mx\n\x6d\xef\x2f\x6d\n\x6c\x61\x2f\x6d\x78\n') - write_file('Xtest4.aff', - 'SET ISO8859-1\n' .. - '\n' .. - 'FOL \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. - '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. - '\xff\n' .. - 'LOW \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. - '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. - '\xff\n' .. - 'UPP \xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce' .. - '\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' .. - '\xff\n' .. - '\n' .. - 'COMPOUNDRULE m+\n' .. - 'COMPOUNDRULE sm*e\n' .. - 'COMPOUNDRULE sm+\n' .. - 'COMPOUNDMIN 3\n' .. - 'COMPOUNDWORDMAX 3\n' .. - 'COMPOUNDFORBIDFLAG t\n' .. - '\n' .. - 'COMPOUNDSYLMAX 5\n' .. - 'SYLLABLE a\xe1e\xe9i\xedo\xf3\xf6\xf5u\xfa\xfc\xfby/aa/au/ea/ee/ei/' .. - 'ie/oa/oe/oo/ou/uu/ui\n' .. - '\n' .. - 'MAP 9\n' .. - 'MAP a\xe0\xe1\xe2\xe3\xe4\xe5\n' .. - 'MAP e\xe8\xe9\xea\xeb\n' .. - 'MAP i\xec\xed\xee\xef\n' .. - 'MAP o\xf2\xf3\xf4\xf5\xf6\n' .. - 'MAP u\xf9\xfa\xfb\xfc\n' .. - 'MAP n\xf1\n' .. - 'MAP c\xe7\n' .. - 'MAP y\xff\xfd\n' .. - 'MAP s\xdf\n' .. - '\n' .. - 'NEEDAFFIX x\n' .. - '\n' .. - 'PFXPOSTPONE\n' .. - '\n' .. - 'MIDWORD \'-\n' .. - '\n' .. - 'SFX q N 1\n' .. - 'SFX q 0 -ok .\n' .. - '\n' .. - 'SFX a Y 2\n' .. - 'SFX a 0 s .\n' .. - 'SFX a 0 ize/t .\n' .. - '\n' .. - 'PFX p N 1\n' .. - 'PFX p 0 pre .\n' .. - '\n' .. - 'PFX P N 1\n' .. - 'PFX P 0 nou .\n') - write_file('Xtest4.dic', [[ + write_latin1('Xtest3.dic', [[ + 1234 + foo/m + bar/mx + mï/m + la/mx + ]]) + write_latin1('Xtest4.aff', [[ + SET ISO8859-1 + + FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ + + COMPOUNDRULE m+ + COMPOUNDRULE sm*e + COMPOUNDRULE sm+ + COMPOUNDMIN 3 + COMPOUNDWORDMAX 3 + COMPOUNDFORBIDFLAG t + + COMPOUNDSYLMAX 5 + SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui + + MAP 9 + MAP aàáâãäå + MAP eèéêë + MAP iìíîï + MAP oòóôõö + MAP uùúûü + MAP nñ + MAP cç + MAP yÿý + MAP sß + + NEEDAFFIX x + + PFXPOSTPONE + + MIDWORD '- + + SFX q N 1 + SFX q 0 -ok . + + SFX a Y 2 + SFX a 0 s . + SFX a 0 ize/t . + + PFX p N 1 + PFX p 0 pre . + + PFX P N 1 + PFX P 0 nou . + ]]) + write_latin1('Xtest4.dic', [[ 1234 word/mP util/am @@ -208,95 +196,103 @@ describe("spell checking with 'encoding' set to utf-8", function() start/s end/e ]]) - write_file('Xtest5.aff', - 'SET ISO8859-1\n' .. - '\n' .. - 'FLAG long\n' .. - '\n' .. - 'NEEDAFFIX !!\n' .. - '\n' .. - 'COMPOUNDRULE ssmm*ee\n' .. - '\n' .. - 'NEEDCOMPOUND xx\n' .. - 'COMPOUNDPERMITFLAG pp\n' .. - '\n' .. - 'SFX 13 Y 1\n' .. - 'SFX 13 0 bork .\n' .. - '\n' .. - 'SFX a1 Y 1\n' .. - 'SFX a1 0 a1 .\n' .. - '\n' .. - 'SFX a\xe9 Y 1\n' .. - 'SFX a\xe9 0 a\xe9 .\n' .. - '\n' .. - 'PFX zz Y 1\n' .. - 'PFX zz 0 pre/pp .\n' .. - '\n' .. - 'PFX yy Y 1\n' .. - 'PFX yy 0 nou .\n') - write_file('Xtest5.dic', - '1234\nfoo/a1a\xe9!!\nbar/zz13ee\nstart/ss\nend/eeyy\nmiddle/mmxx\n') - write_file('Xtest6.aff', - 'SET ISO8859-1\n' .. - '\n' .. - 'FLAG caplong\n' .. - '\n' .. - 'NEEDAFFIX A!\n' .. - '\n' .. - 'COMPOUNDRULE sMm*Ee\n' .. - '\n' .. - 'NEEDCOMPOUND Xx\n' .. - '\n' .. - 'COMPOUNDPERMITFLAG p\n' .. - '\n' .. - 'SFX N3 Y 1\n' .. - 'SFX N3 0 bork .\n' .. - '\n' .. - 'SFX A1 Y 1\n' .. - 'SFX A1 0 a1 .\n' .. - '\n' .. - 'SFX A\xe9 Y 1\n' .. - 'SFX A\xe9 0 a\xe9 .\n' .. - '\n' .. - 'PFX Zz Y 1\n' .. - 'PFX Zz 0 pre/p .\n') - write_file('Xtest6.dic', - '1234\nmee/A1A\xe9A!\nbar/ZzN3Ee\nlead/s\nend/Ee\nmiddle/MmXx\n') - write_file('Xtest7.aff', - 'SET ISO8859-1\n' .. - '\n' .. - 'FOL \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. - '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. - '\xff\n' .. - 'LOW \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. - '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. - '\xff\n' .. - 'UPP \xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce' .. - '\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' .. - '\xff\n' .. - '\n' .. - 'FLAG num\n' .. - '\n' .. - 'NEEDAFFIX 9999\n' .. - '\n' .. - 'COMPOUNDRULE 2,77*123\n' .. - '\n' .. - 'NEEDCOMPOUND 1\n' .. - 'COMPOUNDPERMITFLAG 432\n' .. - '\n' .. - 'SFX 61003 Y 1\n' .. - 'SFX 61003 0 meat .\n' .. - '\n' .. - 'SFX 391 Y 1\n' .. - 'SFX 391 0 a1 .\n' .. - '\n' .. - 'SFX 111 Y 1\n' .. - 'SFX 111 0 a\xe9'.. - ' .\n' .. - '\n' .. - 'PFX 17 Y 1\n' .. - 'PFX 17 0 pre/432 .\n') - write_file('Xtest7.dic', [[ + write_latin1('Xtest5.aff', [[ + SET ISO8859-1 + + FLAG long + + NEEDAFFIX !! + + COMPOUNDRULE ssmm*ee + + NEEDCOMPOUND xx + COMPOUNDPERMITFLAG pp + + SFX 13 Y 1 + SFX 13 0 bork . + + SFX a1 Y 1 + SFX a1 0 a1 . + + SFX aé Y 1 + SFX aé 0 aé . + + PFX zz Y 1 + PFX zz 0 pre/pp . + + PFX yy Y 1 + PFX yy 0 nou . + ]]) + write_latin1('Xtest5.dic', [[ + 1234 + foo/a1aé!! + bar/zz13ee + start/ss + end/eeyy + middle/mmxx + ]]) + write_latin1('Xtest6.aff', [[ + SET ISO8859-1 + + FLAG caplong + + NEEDAFFIX A! + + COMPOUNDRULE sMm*Ee + + NEEDCOMPOUND Xx + + COMPOUNDPERMITFLAG p + + SFX N3 Y 1 + SFX N3 0 bork . + + SFX A1 Y 1 + SFX A1 0 a1 . + + SFX Aé Y 1 + SFX Aé 0 aé . + + PFX Zz Y 1 + PFX Zz 0 pre/p . + ]]) + write_latin1('Xtest6.dic', [[ + 1234 + mee/A1AéA! + bar/ZzN3Ee + lead/s + end/Ee + middle/MmXx + ]]) + write_latin1('Xtest7.aff', [[ + SET ISO8859-1 + + FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ + + FLAG num + + NEEDAFFIX 9999 + + COMPOUNDRULE 2,77*123 + + NEEDCOMPOUND 1 + COMPOUNDPERMITFLAG 432 + + SFX 61003 Y 1 + SFX 61003 0 meat . + + SFX 391 Y 1 + SFX 391 0 a1 . + + SFX 111 Y 1 + SFX 111 0 aé . + + PFX 17 Y 1 + PFX 17 0 pre/432 . + ]]) + write_latin1('Xtest7.dic', [[ 1234 mee/391,111,9999 bar/17,61003,123 @@ -304,167 +300,161 @@ describe("spell checking with 'encoding' set to utf-8", function() tail/123 middle/77,1 ]]) - write_file('Xtest-sal.aff', - 'SET ISO8859-1\n' .. - 'TRY esianrtolcdugmphbyfvkwjkqxz-\xeb\xe9\xe8\xea\xef\xee\xe4\xe0' .. - '\xe2\xf6\xfc\xfb\'ESIANRTOLCDUGMPHBYFVKWJKQXZ\n' .. - '\n' .. - 'FOL \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. - '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. - '\xff\n' .. - 'LOW \xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee' .. - '\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf' .. - '\xff\n' .. - 'UPP \xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce' .. - '\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' .. - '\xff\n' .. - '\n' .. - 'MIDWORD\t\'-\n' .. - '\n' .. - 'KEP =\n' .. - 'RAR ?\n' .. - 'BAD !\n' .. - '\n' .. - '#NOSPLITSUGS\n' .. - '\n' .. - 'PFX I N 1\n' .. - 'PFX I 0 in .\n' .. - '\n' .. - 'PFX O Y 1\n' .. - 'PFX O 0 out .\n' .. - '\n' .. - 'SFX S Y 2\n' .. - 'SFX S 0 s [^s]\n' .. - 'SFX S 0 es s\n' .. - '\n' .. - 'SFX N N 3\n' .. - 'SFX N 0 en [^n]\n' .. - 'SFX N 0 nen n\n' .. - 'SFX N 0 n .\n' .. - '\n' .. - 'REP 3\n' .. - 'REP g ch\n' .. - 'REP ch g\n' .. - 'REP svp s.v.p.\n' .. - '\n' .. - 'MAP 9\n' .. - 'MAP a\xe0\xe1\xe2\xe3\xe4\xe5\n' .. - 'MAP e\xe8\xe9\xea\xeb\n' .. - 'MAP i\xec\xed\xee\xef\n' .. - 'MAP o\xf2\xf3\xf4\xf5\xf6\n' .. - 'MAP u\xf9\xfa\xfb\xfc\n' .. - 'MAP n\xf1\n' .. - 'MAP c\xe7\n' .. - 'MAP y\xff\xfd\n' .. - 'MAP s\xdf\n' .. - '\n' .. - 'SAL AH(AEIOUY)-^ *H\n' .. - 'SAL AR(AEIOUY)-^ *R\n' .. - 'SAL A(HR)^ *\n' .. - 'SAL A^ *\n' .. - 'SAL AH(AEIOUY)- H\n' .. - 'SAL AR(AEIOUY)- R\n' .. - 'SAL A(HR) _\n' .. - 'SAL \xc0^ *\n' .. - 'SAL \xc5^ *\n' .. - 'SAL BB- _\n' .. - 'SAL B B\n' .. - 'SAL CQ- _\n' .. - 'SAL CIA X\n' .. - 'SAL CH X\n' .. - 'SAL C(EIY)- S\n' .. - 'SAL CK K\n' .. - 'SAL COUGH^ KF\n' .. - 'SAL CC< C\n' .. - 'SAL C K\n' .. - 'SAL DG(EIY) K\n' .. - 'SAL DD- _\n' .. - 'SAL D T\n' .. - 'SAL \xc9< E\n' .. - 'SAL EH(AEIOUY)-^ *H\n' .. - 'SAL ER(AEIOUY)-^ *R\n' .. - 'SAL E(HR)^ *\n' .. - 'SAL ENOUGH^$ *NF\n' .. - 'SAL E^ *\n' .. - 'SAL EH(AEIOUY)- H\n' .. - 'SAL ER(AEIOUY)- R\n' .. - 'SAL E(HR) _\n' .. - 'SAL FF- _\n' .. - 'SAL F F\n' .. - 'SAL GN^ N\n' .. - 'SAL GN$ N\n' .. - 'SAL GNS$ NS\n' .. - 'SAL GNED$ N\n' .. - 'SAL GH(AEIOUY)- K\n' .. - 'SAL GH _\n' .. - 'SAL GG9 K\n' .. - 'SAL G K\n' .. - 'SAL H H\n' .. - 'SAL IH(AEIOUY)-^ *H\n' .. - 'SAL IR(AEIOUY)-^ *R\n' .. - 'SAL I(HR)^ *\n' .. - 'SAL I^ *\n' .. - 'SAL ING6 N\n' .. - 'SAL IH(AEIOUY)- H\n' .. - 'SAL IR(AEIOUY)- R\n' .. - 'SAL I(HR) _\n' .. - 'SAL J K\n' .. - 'SAL KN^ N\n' .. - 'SAL KK- _\n' .. - 'SAL K K\n' .. - 'SAL LAUGH^ LF\n' .. - 'SAL LL- _\n' .. - 'SAL L L\n' .. - 'SAL MB$ M\n' .. - 'SAL MM M\n' .. - 'SAL M M\n' .. - 'SAL NN- _\n' .. - 'SAL N N\n' .. - 'SAL OH(AEIOUY)-^ *H\n' .. - 'SAL OR(AEIOUY)-^ *R\n' .. - 'SAL O(HR)^ *\n' .. - 'SAL O^ *\n' .. - 'SAL OH(AEIOUY)- H\n' .. - 'SAL OR(AEIOUY)- R\n' .. - 'SAL O(HR) _\n' .. - 'SAL PH F\n' .. - 'SAL PN^ N\n' .. - 'SAL PP- _\n' .. - 'SAL P P\n' .. - 'SAL Q K\n' .. - 'SAL RH^ R\n' .. - 'SAL ROUGH^ RF\n' .. - 'SAL RR- _\n' .. - 'SAL R R\n' .. - 'SAL SCH(EOU)- SK\n' .. - 'SAL SC(IEY)- S\n' .. - 'SAL SH X\n' .. - 'SAL SI(AO)- X\n' .. - 'SAL SS- _\n' .. - 'SAL S S\n' .. - 'SAL TI(AO)- X\n' .. - 'SAL TH @\n' .. - 'SAL TCH-- _\n' .. - 'SAL TOUGH^ TF\n' .. - 'SAL TT- _\n' .. - 'SAL T T\n' .. - 'SAL UH(AEIOUY)-^ *H\n' .. - 'SAL UR(AEIOUY)-^ *R\n' .. - 'SAL U(HR)^ *\n' .. - 'SAL U^ *\n' .. - 'SAL UH(AEIOUY)- H\n' .. - 'SAL UR(AEIOUY)- R\n' .. - 'SAL U(HR) _\n' .. - 'SAL V^ W\n' .. - 'SAL V F\n' .. - 'SAL WR^ R\n' .. - 'SAL WH^ W\n' .. - 'SAL W(AEIOU)- W\n' .. - 'SAL X^ S\n' .. - 'SAL X KS\n' .. - 'SAL Y(AEIOU)- Y\n' .. - 'SAL ZZ- _\n' .. - 'SAL Z S\n') + write_latin1('Xtest-sal.aff', [[ + SET ISO8859-1 + TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ + + FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ + UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ + + MIDWORD '- + + KEP = + RAR ? + BAD ! + + #NOSPLITSUGS + + PFX I N 1 + PFX I 0 in . + + PFX O Y 1 + PFX O 0 out . + + SFX S Y 2 + SFX S 0 s [^s] + SFX S 0 es s + + SFX N N 3 + SFX N 0 en [^n] + SFX N 0 nen n + SFX N 0 n . + + REP 3 + REP g ch + REP ch g + REP svp s.v.p. + + MAP 9 + MAP aàáâãäå + MAP eèéêë + MAP iìíîï + MAP oòóôõö + MAP uùúûü + MAP nñ + MAP cç + MAP yÿý + MAP sß + + SAL AH(AEIOUY)-^ *H + SAL AR(AEIOUY)-^ *R + SAL A(HR)^ * + SAL A^ * + SAL AH(AEIOUY)- H + SAL AR(AEIOUY)- R + SAL A(HR) _ + SAL À^ * + SAL Å^ * + SAL BB- _ + SAL B B + SAL CQ- _ + SAL CIA X + SAL CH X + SAL C(EIY)- S + SAL CK K + SAL COUGH^ KF + SAL CC< C + SAL C K + SAL DG(EIY) K + SAL DD- _ + SAL D T + SAL É< E + SAL EH(AEIOUY)-^ *H + SAL ER(AEIOUY)-^ *R + SAL E(HR)^ * + SAL ENOUGH^$ *NF + SAL E^ * + SAL EH(AEIOUY)- H + SAL ER(AEIOUY)- R + SAL E(HR) _ + SAL FF- _ + SAL F F + SAL GN^ N + SAL GN$ N + SAL GNS$ NS + SAL GNED$ N + SAL GH(AEIOUY)- K + SAL GH _ + SAL GG9 K + SAL G K + SAL H H + SAL IH(AEIOUY)-^ *H + SAL IR(AEIOUY)-^ *R + SAL I(HR)^ * + SAL I^ * + SAL ING6 N + SAL IH(AEIOUY)- H + SAL IR(AEIOUY)- R + SAL I(HR) _ + SAL J K + SAL KN^ N + SAL KK- _ + SAL K K + SAL LAUGH^ LF + SAL LL- _ + SAL L L + SAL MB$ M + SAL MM M + SAL M M + SAL NN- _ + SAL N N + SAL OH(AEIOUY)-^ *H + SAL OR(AEIOUY)-^ *R + SAL O(HR)^ * + SAL O^ * + SAL OH(AEIOUY)- H + SAL OR(AEIOUY)- R + SAL O(HR) _ + SAL PH F + SAL PN^ N + SAL PP- _ + SAL P P + SAL Q K + SAL RH^ R + SAL ROUGH^ RF + SAL RR- _ + SAL R R + SAL SCH(EOU)- SK + SAL SC(IEY)- S + SAL SH X + SAL SI(AO)- X + SAL SS- _ + SAL S S + SAL TI(AO)- X + SAL TH @ + SAL TCH-- _ + SAL TOUGH^ TF + SAL TT- _ + SAL T T + SAL UH(AEIOUY)-^ *H + SAL UR(AEIOUY)-^ *R + SAL U(HR)^ * + SAL U^ * + SAL UH(AEIOUY)- H + SAL UR(AEIOUY)- R + SAL U(HR) _ + SAL V^ W + SAL V F + SAL WR^ R + SAL WH^ W + SAL W(AEIOU)- W + SAL X^ S + SAL X KS + SAL Y(AEIOU)- Y + SAL ZZ- _ + SAL Z S + ]]) write_file('Xtest.utf-8.add', [[ /regions=usgbnz elequint/2 -- cgit