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