diff options
author | Lucas Hoffmann <l-m-h@web.de> | 2015-07-15 10:00:56 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2015-08-26 10:30:44 +0200 |
commit | f3c67a617e843506e31e5a1dc82eafa46cdfca22 (patch) | |
tree | f392ef968a54a7a138e60b3043ae55e3242127eb | |
parent | ffe88f0d52516395b3de4983c88e795a76debf27 (diff) | |
download | rneovim-f3c67a617e843506e31e5a1dc82eafa46cdfca22.tar.gz rneovim-f3c67a617e843506e31e5a1dc82eafa46cdfca22.tar.bz2 rneovim-f3c67a617e843506e31e5a1dc82eafa46cdfca22.zip |
test59: Write spell files from lua and use cp to get the right files in place
Use teardown to remove these temporary files
-rw-r--r-- | test/functional/legacy/059_utf8_spell_checking_spec.lua | 974 |
1 files 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. |