comparison src/testdir/test_spell.vim @ 18017:988e5a868b60 v8.1.2004

patch 8.1.2004: more functions can be used as methods Commit: https://github.com/vim/vim/commit/f6ed61e1489e40eada55a4f1782e1ed82bcad7d9 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 7 19:05:09 2019 +0200 patch 8.1.2004: more functions can be used as methods Problem: More functions can be used as methods. Solution: Make various functions usable as a method.
author Bram Moolenaar <Bram@vim.org>
date Sat, 07 Sep 2019 19:15:04 +0200
parents cc68aca87c17
children 57b18521216f
comparison
equal deleted inserted replaced
18016:834b7854aa3c 18017:988e5a868b60
71 " Test spellbadword() with argument 71 " Test spellbadword() with argument
72 func Test_spellbadword() 72 func Test_spellbadword()
73 set spell 73 set spell
74 74
75 call assert_equal(['bycycle', 'bad'], spellbadword('My bycycle.')) 75 call assert_equal(['bycycle', 'bad'], spellbadword('My bycycle.'))
76 call assert_equal(['another', 'caps'], spellbadword('A sentence. another sentence')) 76 call assert_equal(['another', 'caps'], 'A sentence. another sentence'->spellbadword())
77 77
78 set spelllang=en 78 set spelllang=en
79 call assert_equal(['', ''], spellbadword('centre')) 79 call assert_equal(['', ''], spellbadword('centre'))
80 call assert_equal(['', ''], spellbadword('center')) 80 call assert_equal(['', ''], spellbadword('center'))
81 set spelllang=en_us 81 set spelllang=en_us
177 \ ["the", ["put", "uk", "test"]], 177 \ ["the", ["put", "uk", "test"]],
178 \ ] 178 \ ]
179 \ ) 179 \ )
180 180
181 call assert_equal("gebletegek", soundfold('goobledygoook')) 181 call assert_equal("gebletegek", soundfold('goobledygoook'))
182 call assert_equal("kepereneven", soundfold('kóopërÿnôven')) 182 call assert_equal("kepereneven", 'kóopërÿnôven'->soundfold())
183 call assert_equal("everles gesvets etele", soundfold('oeverloos gezwets edale')) 183 call assert_equal("everles gesvets etele", soundfold('oeverloos gezwets edale'))
184 endfunc 184 endfunc
185 185
186 " Postponed prefixes 186 " Postponed prefixes
187 func Test_zz_prefixes() 187 func Test_zz_prefixes()
438 let [bad, a] = spellbadword() 438 let [bad, a] = spellbadword()
439 if bad == '' || bad == prevbad || bad == 'badend' 439 if bad == '' || bad == prevbad || bad == 'badend'
440 break 440 break
441 endif 441 endif
442 let prevbad = bad 442 let prevbad = bad
443 let lst = spellsuggest(bad, 3) 443 let lst = bad->spellsuggest(3)
444 normal mm 444 normal mm
445 445
446 call add(result, [bad, lst]) 446 call add(result, [bad, lst])
447 normal `m]s 447 normal `m]s
448 endwhile 448 endwhile