Bram Moolenaar | d3f78dc | 2017-02-25 14:21:10 +0100 | [diff] [blame] | 1 | " Test spell checking |
Bram Moolenaar | 5bcc5a1 | 2019-08-06 22:48:02 +0200 | [diff] [blame] | 2 | " Note: this file uses latin1 encoding, but is used with utf-8 encoding. |
Bram Moolenaar | d3f78dc | 2017-02-25 14:21:10 +0100 | [diff] [blame] | 3 | |
Bram Moolenaar | b46fecd | 2019-06-15 17:58:09 +0200 | [diff] [blame] | 4 | CheckFeature spell |
Bram Moolenaar | d3f78dc | 2017-02-25 14:21:10 +0100 | [diff] [blame] | 5 | |
Christian Brabandt | eb380b9 | 2025-07-07 20:53:55 +0200 | [diff] [blame] | 6 | source util/screendump.vim |
Bram Moolenaar | 7751d1d | 2019-10-18 20:37:08 +0200 | [diff] [blame] | 7 | |
Bram Moolenaar | 1a0f200 | 2017-07-28 15:38:10 +0200 | [diff] [blame] | 8 | func TearDown() |
| 9 | set nospell |
| 10 | call delete('Xtest.aff') |
| 11 | call delete('Xtest.dic') |
| 12 | call delete('Xtest.latin1.add') |
| 13 | call delete('Xtest.latin1.add.spl') |
| 14 | call delete('Xtest.latin1.spl') |
| 15 | call delete('Xtest.latin1.sug') |
zeertzjq | 288ed23 | 2022-07-04 11:03:07 +0100 | [diff] [blame] | 16 | " set 'encoding' to clear the word list |
| 17 | set encoding=utf-8 |
Bram Moolenaar | 1a0f200 | 2017-07-28 15:38:10 +0200 | [diff] [blame] | 18 | endfunc |
| 19 | |
Bram Moolenaar | d3f78dc | 2017-02-25 14:21:10 +0100 | [diff] [blame] | 20 | func Test_wrap_search() |
| 21 | new |
| 22 | call setline(1, ['The', '', 'A plong line with two zpelling mistakes', '', 'End']) |
| 23 | set spell wrapscan |
| 24 | normal ]s |
| 25 | call assert_equal('plong', expand('<cword>')) |
| 26 | normal ]s |
| 27 | call assert_equal('zpelling', expand('<cword>')) |
| 28 | normal ]s |
| 29 | call assert_equal('plong', expand('<cword>')) |
| 30 | bwipe! |
| 31 | set nospell |
| 32 | endfunc |
Bram Moolenaar | 5b276aa | 2017-04-22 23:49:52 +0200 | [diff] [blame] | 33 | |
Bram Moolenaar | b73fa62 | 2017-12-21 20:27:47 +0100 | [diff] [blame] | 34 | func Test_curswant() |
| 35 | new |
| 36 | call setline(1, ['Another plong line', 'abcdefghijklmnopq']) |
| 37 | set spell wrapscan |
| 38 | normal 0]s |
| 39 | call assert_equal('plong', expand('<cword>')) |
| 40 | normal j |
| 41 | call assert_equal(9, getcurpos()[2]) |
| 42 | normal 0[s |
| 43 | call assert_equal('plong', expand('<cword>')) |
| 44 | normal j |
| 45 | call assert_equal(9, getcurpos()[2]) |
| 46 | |
| 47 | normal 0]S |
| 48 | call assert_equal('plong', expand('<cword>')) |
| 49 | normal j |
| 50 | call assert_equal(9, getcurpos()[2]) |
| 51 | normal 0[S |
| 52 | call assert_equal('plong', expand('<cword>')) |
| 53 | normal j |
| 54 | call assert_equal(9, getcurpos()[2]) |
| 55 | |
| 56 | normal 1G0 |
| 57 | call assert_equal('plong', spellbadword()[0]) |
| 58 | normal j |
| 59 | call assert_equal(9, getcurpos()[2]) |
| 60 | |
| 61 | bwipe! |
| 62 | set nospell |
| 63 | endfunc |
| 64 | |
Bram Moolenaar | 5b276aa | 2017-04-22 23:49:52 +0200 | [diff] [blame] | 65 | func Test_z_equal_on_invalid_utf8_word() |
| 66 | split |
| 67 | set spell |
| 68 | call setline(1, "\xff") |
| 69 | norm z= |
| 70 | set nospell |
| 71 | bwipe! |
| 72 | endfunc |
Bram Moolenaar | 545cb79 | 2017-05-23 11:31:22 +0200 | [diff] [blame] | 73 | |
Bram Moolenaar | 156d391 | 2022-06-18 14:09:08 +0100 | [diff] [blame] | 74 | func Test_z_equal_on_single_character() |
| 75 | " this was decrementing the index below zero |
| 76 | new |
| 77 | norm a0\Ê |
| 78 | norm zW |
| 79 | norm z= |
| 80 | |
| 81 | bwipe! |
| 82 | endfunc |
| 83 | |
Bram Moolenaar | 872e451 | 2018-07-20 23:36:26 +0200 | [diff] [blame] | 84 | " Test spellbadword() with argument |
| 85 | func Test_spellbadword() |
| 86 | set spell |
| 87 | |
| 88 | call assert_equal(['bycycle', 'bad'], spellbadword('My bycycle.')) |
Bram Moolenaar | f6ed61e | 2019-09-07 19:05:09 +0200 | [diff] [blame] | 89 | call assert_equal(['another', 'caps'], 'A sentence. another sentence'->spellbadword()) |
Bram Moolenaar | 872e451 | 2018-07-20 23:36:26 +0200 | [diff] [blame] | 90 | |
Bram Moolenaar | 362b44b | 2020-06-10 21:47:00 +0200 | [diff] [blame] | 91 | call assert_equal(['TheCamelWord', 'bad'], 'TheCamelWord asdf'->spellbadword()) |
| 92 | set spelloptions=camel |
| 93 | call assert_equal(['asdf', 'bad'], 'TheCamelWord asdf'->spellbadword()) |
| 94 | set spelloptions= |
| 95 | |
Bram Moolenaar | 872e451 | 2018-07-20 23:36:26 +0200 | [diff] [blame] | 96 | set spelllang=en |
| 97 | call assert_equal(['', ''], spellbadword('centre')) |
| 98 | call assert_equal(['', ''], spellbadword('center')) |
| 99 | set spelllang=en_us |
| 100 | call assert_equal(['centre', 'local'], spellbadword('centre')) |
| 101 | call assert_equal(['', ''], spellbadword('center')) |
| 102 | set spelllang=en_gb |
| 103 | call assert_equal(['', ''], spellbadword('centre')) |
| 104 | call assert_equal(['center', 'local'], spellbadword('center')) |
| 105 | |
| 106 | " Create a small word list to test that spellbadword('...') |
| 107 | " can return ['...', 'rare']. |
| 108 | e Xwords |
| 109 | insert |
| 110 | foo |
| 111 | foobar/? |
| 112 | . |
| 113 | w! |
| 114 | mkspell! Xwords.spl Xwords |
| 115 | set spelllang=Xwords.spl |
| 116 | call assert_equal(['foobar', 'rare'], spellbadword('foo foobar')) |
| 117 | |
Bram Moolenaar | 152e79e | 2020-06-10 15:32:08 +0200 | [diff] [blame] | 118 | " Typo should be detected even without the 'spell' option. |
Bram Moolenaar | 872e451 | 2018-07-20 23:36:26 +0200 | [diff] [blame] | 119 | set spelllang=en_gb nospell |
| 120 | call assert_equal(['', ''], spellbadword('centre')) |
Bram Moolenaar | 152e79e | 2020-06-10 15:32:08 +0200 | [diff] [blame] | 121 | call assert_equal(['bycycle', 'bad'], spellbadword('My bycycle.')) |
| 122 | call assert_equal(['another', 'caps'], spellbadword('A sentence. another sentence')) |
| 123 | |
| 124 | set spelllang= |
| 125 | call assert_fails("call spellbadword('maxch')", 'E756:') |
Bram Moolenaar | 96fdf43 | 2020-09-11 18:11:50 +0200 | [diff] [blame] | 126 | call assert_fails("spelldump", 'E756:') |
Bram Moolenaar | 872e451 | 2018-07-20 23:36:26 +0200 | [diff] [blame] | 127 | |
| 128 | call delete('Xwords.spl') |
| 129 | call delete('Xwords') |
| 130 | set spelllang& |
| 131 | set spell& |
| 132 | endfunc |
| 133 | |
LemonBoy | d087450 | 2023-08-27 21:52:27 +0200 | [diff] [blame] | 134 | func Test_spell_camelcase() |
| 135 | set spell spelloptions=camel |
| 136 | let words = [ |
| 137 | \ 'UPPER', |
| 138 | \ 'lower', |
| 139 | \ 'mixedCase', |
| 140 | \ 'HTML', |
| 141 | \ 'XMLHttpRequest', |
| 142 | \ 'foo123bar', |
| 143 | \ '12345678', |
| 144 | \ 'HELLO123world', |
| 145 | \] |
| 146 | |
| 147 | for word in words |
| 148 | call assert_equal(['', ''], spellbadword(word)) |
| 149 | endfor |
| 150 | |
| 151 | set spell& spelloptions& |
| 152 | endfunc |
| 153 | |
Bram Moolenaar | d569a9e | 2020-09-28 23:13:15 +0200 | [diff] [blame] | 154 | func Test_spell_file_missing() |
| 155 | let s:spell_file_missing = 0 |
| 156 | augroup TestSpellFileMissing |
| 157 | autocmd! SpellFileMissing * let s:spell_file_missing += 1 |
| 158 | augroup END |
| 159 | |
| 160 | set spell spelllang=ab_cd |
| 161 | let messages = GetMessages() |
| 162 | call assert_equal('Warning: Cannot find word list "ab.utf-8.spl" or "ab.ascii.spl"', messages[-1]) |
| 163 | call assert_equal(1, s:spell_file_missing) |
| 164 | |
| 165 | new XTestSpellFileMissing |
| 166 | augroup TestSpellFileMissing |
| 167 | autocmd! SpellFileMissing * bwipe |
| 168 | augroup END |
Bram Moolenaar | 371951d | 2022-09-28 14:08:23 +0100 | [diff] [blame] | 169 | call assert_fails('set spell spelllang=ab_cd', 'E937:') |
Bram Moolenaar | d569a9e | 2020-09-28 23:13:15 +0200 | [diff] [blame] | 170 | |
Bram Moolenaar | fc9f0fd | 2022-06-15 16:57:44 +0100 | [diff] [blame] | 171 | " clean up |
| 172 | augroup TestSpellFileMissing |
| 173 | autocmd! SpellFileMissing |
| 174 | augroup END |
Bram Moolenaar | d569a9e | 2020-09-28 23:13:15 +0200 | [diff] [blame] | 175 | augroup! TestSpellFileMissing |
| 176 | unlet s:spell_file_missing |
| 177 | set spell& spelllang& |
| 178 | %bwipe! |
| 179 | endfunc |
| 180 | |
Bram Moolenaar | c3d27ad | 2022-11-14 20:52:14 +0000 | [diff] [blame] | 181 | func Test_spell_file_missing_bwipe() |
| 182 | " this was using a window that was wiped out in a SpellFileMissing autocmd |
| 183 | set spelllang=xy |
| 184 | au SpellFileMissing * n0 |
| 185 | set spell |
| 186 | au SpellFileMissing * bw |
| 187 | snext somefile |
| 188 | |
| 189 | au! SpellFileMissing |
| 190 | bwipe! |
| 191 | set nospell spelllang=en |
| 192 | endfunc |
| 193 | |
Bram Moolenaar | f12f002 | 2020-10-07 12:58:44 +0200 | [diff] [blame] | 194 | func Test_spelldump() |
Bram Moolenaar | fc9f0fd | 2022-06-15 16:57:44 +0100 | [diff] [blame] | 195 | " In case the spell file is not found avoid getting the download dialog, we |
| 196 | " would get stuck at the prompt. |
| 197 | let g:en_not_found = 0 |
| 198 | augroup TestSpellFileMissing |
| 199 | au! SpellFileMissing * let g:en_not_found = 1 |
| 200 | augroup END |
Bram Moolenaar | f12f002 | 2020-10-07 12:58:44 +0200 | [diff] [blame] | 201 | set spell spelllang=en |
| 202 | spellrare! emacs |
Bram Moolenaar | fc9f0fd | 2022-06-15 16:57:44 +0100 | [diff] [blame] | 203 | if g:en_not_found |
| 204 | call assert_report("Could not find English spell file") |
| 205 | else |
| 206 | spelldump |
Bram Moolenaar | f12f002 | 2020-10-07 12:58:44 +0200 | [diff] [blame] | 207 | |
Bram Moolenaar | fc9f0fd | 2022-06-15 16:57:44 +0100 | [diff] [blame] | 208 | " Check assumption about region: 1: us, 2: au, 3: ca, 4: gb, 5: nz. |
| 209 | call assert_equal('/regions=usaucagbnz', getline(1)) |
| 210 | call assert_notequal(0, search('^theater/1$')) " US English only. |
| 211 | call assert_notequal(0, search('^theatre/2345$')) " AU, CA, GB or NZ English. |
Bram Moolenaar | f12f002 | 2020-10-07 12:58:44 +0200 | [diff] [blame] | 212 | |
Bram Moolenaar | fc9f0fd | 2022-06-15 16:57:44 +0100 | [diff] [blame] | 213 | call assert_notequal(0, search('^emacs/?$')) " ? for a rare word. |
| 214 | call assert_notequal(0, search('^the the/!$')) " ! for a wrong word. |
| 215 | endif |
Bram Moolenaar | f12f002 | 2020-10-07 12:58:44 +0200 | [diff] [blame] | 216 | |
Bram Moolenaar | fc9f0fd | 2022-06-15 16:57:44 +0100 | [diff] [blame] | 217 | " clean up |
| 218 | unlet g:en_not_found |
| 219 | augroup TestSpellFileMissing |
| 220 | autocmd! SpellFileMissing |
| 221 | augroup END |
| 222 | augroup! TestSpellFileMissing |
Bram Moolenaar | f12f002 | 2020-10-07 12:58:44 +0200 | [diff] [blame] | 223 | bwipe |
| 224 | set spell& |
| 225 | endfunc |
| 226 | |
| 227 | func Test_spelldump_bang() |
| 228 | new |
| 229 | call setline(1, 'This is a sample sentence.') |
| 230 | redraw |
Bram Moolenaar | fc9f0fd | 2022-06-15 16:57:44 +0100 | [diff] [blame] | 231 | |
| 232 | " In case the spell file is not found avoid getting the download dialog, we |
| 233 | " would get stuck at the prompt. |
| 234 | let g:en_not_found = 0 |
| 235 | augroup TestSpellFileMissing |
| 236 | au! SpellFileMissing * let g:en_not_found = 1 |
| 237 | augroup END |
| 238 | |
Bram Moolenaar | f12f002 | 2020-10-07 12:58:44 +0200 | [diff] [blame] | 239 | set spell |
Bram Moolenaar | f12f002 | 2020-10-07 12:58:44 +0200 | [diff] [blame] | 240 | |
Bram Moolenaar | fc9f0fd | 2022-06-15 16:57:44 +0100 | [diff] [blame] | 241 | if g:en_not_found |
| 242 | call assert_report("Could not find English spell file") |
| 243 | else |
| 244 | redraw |
| 245 | spelldump! |
Bram Moolenaar | f12f002 | 2020-10-07 12:58:44 +0200 | [diff] [blame] | 246 | |
Bram Moolenaar | fc9f0fd | 2022-06-15 16:57:44 +0100 | [diff] [blame] | 247 | " :spelldump! includes the number of times a word was found while updating |
| 248 | " the screen. |
| 249 | " Common word count starts at 10, regular word count starts at 0. |
| 250 | call assert_notequal(0, search("^is\t11$")) " common word found once. |
| 251 | call assert_notequal(0, search("^the\t10$")) " common word never found. |
| 252 | call assert_notequal(0, search("^sample\t1$")) " regular word found once. |
| 253 | call assert_equal(0, search("^screen\t")) " regular word never found. |
| 254 | endif |
| 255 | |
| 256 | " clean up |
| 257 | unlet g:en_not_found |
| 258 | augroup TestSpellFileMissing |
| 259 | autocmd! SpellFileMissing |
| 260 | augroup END |
| 261 | augroup! TestSpellFileMissing |
Bram Moolenaar | f12f002 | 2020-10-07 12:58:44 +0200 | [diff] [blame] | 262 | %bwipe! |
| 263 | set spell& |
| 264 | endfunc |
| 265 | |
Bram Moolenaar | 8c7ad36 | 2020-09-27 13:58:38 +0200 | [diff] [blame] | 266 | func Test_spelllang_inv_region() |
| 267 | set spell spelllang=en_xx |
| 268 | let messages = GetMessages() |
| 269 | call assert_equal('Warning: region xx not supported', messages[-1]) |
| 270 | set spell& spelllang& |
| 271 | endfunc |
| 272 | |
| 273 | func Test_compl_with_CTRL_X_CTRL_K_using_spell() |
| 274 | " When spell checking is enabled and 'dictionary' is empty, |
| 275 | " CTRL-X CTRL-K in insert mode completes using the spelling dictionary. |
| 276 | new |
| 277 | set spell spelllang=en dictionary= |
| 278 | |
| 279 | set ignorecase |
| 280 | call feedkeys("Senglis\<c-x>\<c-k>\<esc>", 'tnx') |
| 281 | call assert_equal(['English'], getline(1, '$')) |
| 282 | call feedkeys("SEnglis\<c-x>\<c-k>\<esc>", 'tnx') |
| 283 | call assert_equal(['English'], getline(1, '$')) |
| 284 | |
| 285 | set noignorecase |
| 286 | call feedkeys("Senglis\<c-x>\<c-k>\<esc>", 'tnx') |
| 287 | call assert_equal(['englis'], getline(1, '$')) |
| 288 | call feedkeys("SEnglis\<c-x>\<c-k>\<esc>", 'tnx') |
| 289 | call assert_equal(['English'], getline(1, '$')) |
| 290 | |
| 291 | set spelllang=en_us |
| 292 | call feedkeys("Stheat\<c-x>\<c-k>\<esc>", 'tnx') |
| 293 | call assert_equal(['theater'], getline(1, '$')) |
| 294 | set spelllang=en_gb |
| 295 | call feedkeys("Stheat\<c-x>\<c-k>\<esc>", 'tnx') |
LemonBoy | e98fb64 | 2023-08-15 23:07:55 +0200 | [diff] [blame] | 296 | call assert_equal(['theatre'], getline(1, '$')) |
Bram Moolenaar | 8c7ad36 | 2020-09-27 13:58:38 +0200 | [diff] [blame] | 297 | |
| 298 | bwipe! |
| 299 | set spell& spelllang& dictionary& ignorecase& |
| 300 | endfunc |
| 301 | |
zeertzjq | 7002c05 | 2024-06-21 07:55:07 +0200 | [diff] [blame] | 302 | func Test_compl_with_CTRL_X_s() |
| 303 | new |
| 304 | set spell spelllang=en_us showmode |
| 305 | inoremap <buffer><F2> <Cmd>let g:msg = Screenline(&lines)<CR> |
| 306 | |
| 307 | call feedkeys("STheatre\<C-X>s\<F2>\<C-Y>\<Esc>", 'tx') |
| 308 | call assert_equal(['Theater'], getline(1, '$')) |
| 309 | call assert_match('(^S^N^P)', g:msg) |
| 310 | |
| 311 | bwipe! |
| 312 | set spell& spelllang& showmode& |
| 313 | unlet g:msg |
| 314 | endfunc |
| 315 | |
zeertzjq | 59f7038 | 2023-06-06 15:59:59 +0100 | [diff] [blame] | 316 | func Test_spellrepall() |
Bram Moolenaar | 545cb79 | 2017-05-23 11:31:22 +0200 | [diff] [blame] | 317 | new |
| 318 | set spell |
| 319 | call assert_fails('spellrepall', 'E752:') |
| 320 | call setline(1, ['A speling mistake. The same speling mistake.', |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 321 | \ 'Another speling mistake.']) |
Bram Moolenaar | 545cb79 | 2017-05-23 11:31:22 +0200 | [diff] [blame] | 322 | call feedkeys(']s1z=', 'tx') |
| 323 | call assert_equal('A spelling mistake. The same speling mistake.', getline(1)) |
| 324 | call assert_equal('Another speling mistake.', getline(2)) |
| 325 | spellrepall |
| 326 | call assert_equal('A spelling mistake. The same spelling mistake.', getline(1)) |
| 327 | call assert_equal('Another spelling mistake.', getline(2)) |
| 328 | call assert_fails('spellrepall', 'E753:') |
| 329 | set spell& |
| 330 | bwipe! |
| 331 | endfunc |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 332 | |
Bram Moolenaar | 54e5fed | 2022-07-04 13:37:07 +0100 | [diff] [blame] | 333 | func Test_spell_dump_word_length() |
| 334 | " this was running over MAXWLEN |
| 335 | new |
| 336 | noremap 0 0a0zW0000000 |
| 337 | sil! norm 0z=0 |
| 338 | sil norm 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |
| 339 | sil! norm 0z=0 |
| 340 | |
| 341 | bwipe! |
| 342 | nunmap 0 |
| 343 | endfunc |
| 344 | |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 345 | " Test spellsuggest({word} [, {max} [, {capital}]]) |
| 346 | func Test_spellsuggest() |
Bram Moolenaar | 152e79e | 2020-06-10 15:32:08 +0200 | [diff] [blame] | 347 | " Verify suggestions are given even when spell checking is not enabled. |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 348 | set nospell |
Bram Moolenaar | 152e79e | 2020-06-10 15:32:08 +0200 | [diff] [blame] | 349 | call assert_equal(['march', 'March'], spellsuggest('marrch', 2)) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 350 | |
| 351 | set spell |
| 352 | |
| 353 | " With 1 argument. |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 354 | call assert_equal(['march', 'March'], spellsuggest('marrch')[0:1]) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 355 | |
| 356 | " With 2 arguments. |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 357 | call assert_equal(['march', 'March'], spellsuggest('marrch', 2)) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 358 | |
| 359 | " With 3 arguments. |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 360 | call assert_equal(['march'], spellsuggest('marrch', 1, 0)) |
| 361 | call assert_equal(['March'], spellsuggest('marrch', 1, 1)) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 362 | |
| 363 | " Test with digits and hyphen. |
| 364 | call assert_equal('Carbon-14', spellsuggest('Carbon-15')[0]) |
| 365 | |
| 366 | " Comment taken from spellsuggest.c explains the following test cases: |
| 367 | " |
| 368 | " If there are more UPPER than lower case letters suggest an |
| 369 | " ALLCAP word. Otherwise, if the first letter is UPPER then |
| 370 | " suggest ONECAP. Exception: "ALl" most likely should be "All", |
| 371 | " require three upper case letters. |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 372 | call assert_equal(['THIRD', 'third'], spellsuggest('thIRD', 2)) |
| 373 | call assert_equal(['third', 'THIRD'], spellsuggest('tHIrd', 2)) |
| 374 | call assert_equal(['Third'], spellsuggest('THird', 1)) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 375 | call assert_equal(['All'], spellsuggest('ALl', 1)) |
| 376 | |
Dominique Pelle | f645ee4 | 2021-12-05 13:21:18 +0000 | [diff] [blame] | 377 | " Special suggestion for repeated 'the the'. |
| 378 | call assert_inrange(0, 2, index(spellsuggest('the the', 3), 'the')) |
| 379 | call assert_inrange(0, 2, index(spellsuggest('the the', 3), 'the')) |
| 380 | call assert_inrange(0, 2, index(spellsuggest('The the', 3), 'The')) |
| 381 | |
Bram Moolenaar | 0e05de4 | 2020-03-25 22:23:46 +0100 | [diff] [blame] | 382 | call assert_fails("call spellsuggest('maxch', [])", 'E745:') |
| 383 | call assert_fails("call spellsuggest('maxch', 2, [])", 'E745:') |
| 384 | |
Bram Moolenaar | 152e79e | 2020-06-10 15:32:08 +0200 | [diff] [blame] | 385 | set spelllang= |
| 386 | call assert_fails("call spellsuggest('maxch')", 'E756:') |
| 387 | set spelllang& |
| 388 | |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 389 | set spell& |
| 390 | endfunc |
| 391 | |
| 392 | " Test 'spellsuggest' option with methods fast, best and double. |
| 393 | func Test_spellsuggest_option_methods() |
| 394 | set spell |
| 395 | |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 396 | for e in ['latin1', 'utf-8'] |
| 397 | exe 'set encoding=' .. e |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 398 | |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 399 | set spellsuggest=fast |
| 400 | call assert_equal(['Stick', 'Stitch'], spellsuggest('Stich', 2), e) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 401 | |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 402 | " With best or double option, "Stitch" should become the top suggestion |
| 403 | " because of better phonetic matching. |
| 404 | set spellsuggest=best |
| 405 | call assert_equal(['Stitch', 'Stick'], spellsuggest('Stich', 2), e) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 406 | |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 407 | set spellsuggest=double |
| 408 | call assert_equal(['Stitch', 'Stick'], spellsuggest('Stich', 2), e) |
| 409 | endfor |
| 410 | |
| 411 | set spell& spellsuggest& encoding& |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 412 | endfunc |
| 413 | |
| 414 | " Test 'spellsuggest' option with value file:{filename} |
| 415 | func Test_spellsuggest_option_file() |
| 416 | set spell spellsuggest=file:Xspellsuggest |
| 417 | call writefile(['emacs/vim', |
| 418 | \ 'theribal/terrible', |
| 419 | \ 'teribal/terrrible', |
| 420 | \ 'terribal'], |
| 421 | \ 'Xspellsuggest') |
| 422 | |
| 423 | call assert_equal(['vim'], spellsuggest('emacs', 2)) |
| 424 | call assert_equal(['terrible'], spellsuggest('theribal',2)) |
| 425 | |
| 426 | " If the suggestion is misspelled (*terrrible* with 3 r), |
| 427 | " it should not be proposed. |
| 428 | " The entry for "terribal" should be ignored because of missing slash. |
| 429 | call assert_equal([], spellsuggest('teribal', 2)) |
| 430 | call assert_equal([], spellsuggest('terribal', 2)) |
| 431 | |
| 432 | set spell spellsuggest=best,file:Xspellsuggest |
| 433 | call assert_equal(['vim', 'Emacs'], spellsuggest('emacs', 2)) |
| 434 | call assert_equal(['terrible', 'tribal'], spellsuggest('theribal', 2)) |
| 435 | call assert_equal(['tribal'], spellsuggest('teribal', 1)) |
| 436 | call assert_equal(['tribal'], spellsuggest('terribal', 1)) |
| 437 | |
| 438 | call delete('Xspellsuggest') |
| 439 | call assert_fails("call spellsuggest('vim')", "E484: Can't open file Xspellsuggest") |
| 440 | |
| 441 | set spellsuggest& spell& |
| 442 | endfunc |
| 443 | |
| 444 | " Test 'spellsuggest' option with value {number} |
| 445 | " to limit the number of suggestions |
| 446 | func Test_spellsuggest_option_number() |
| 447 | set spell spellsuggest=2,best |
| 448 | new |
| 449 | |
| 450 | " We limited the number of suggestions to 2, so selecting |
| 451 | " the 1st and 2nd suggestion should correct the word, but |
| 452 | " selecting a 3rd suggestion should do nothing. |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 453 | call setline(1, 'A baord') |
| 454 | norm $1z= |
| 455 | call assert_equal('A board', getline(1)) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 456 | |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 457 | call setline(1, 'A baord') |
| 458 | norm $2z= |
| 459 | call assert_equal('A bard', getline(1)) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 460 | |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 461 | call setline(1, 'A baord') |
| 462 | norm $3z= |
| 463 | call assert_equal('A baord', getline(1)) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 464 | |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 465 | let a = execute('norm $z=') |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 466 | call assert_equal( |
| 467 | \ "\n" |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 468 | \ .. "Change \"baord\" to:\n" |
| 469 | \ .. " 1 \"board\"\n" |
| 470 | \ .. " 2 \"bard\"\n" |
Bram Moolenaar | d281b7c | 2020-06-10 16:39:32 +0200 | [diff] [blame] | 471 | \ .. "Type number and <Enter> or click with the mouse (q or empty cancels): ", a) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 472 | |
| 473 | set spell spellsuggest=0 |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 474 | call assert_equal("\nSorry, no suggestions", execute('norm $z=')) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 475 | |
| 476 | " Unlike z=, function spellsuggest(...) should not be affected by the |
| 477 | " max number of suggestions (2) set by the 'spellsuggest' option. |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 478 | call assert_equal(['board', 'bard', 'broad'], spellsuggest('baord', 3)) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 479 | |
| 480 | set spellsuggest& spell& |
| 481 | bwipe! |
| 482 | endfunc |
| 483 | |
| 484 | " Test 'spellsuggest' option with value expr:{expr} |
| 485 | func Test_spellsuggest_option_expr() |
| 486 | " A silly 'spellsuggest' function which makes suggestions all uppercase |
| 487 | " and makes the score of each suggestion the length of the suggested word. |
| 488 | " So shorter suggestions are preferred. |
| 489 | func MySuggest() |
| 490 | let spellsuggest_save = &spellsuggest |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 491 | set spellsuggest=3,best |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 492 | let result = map(spellsuggest(v:val, 3), "[toupper(v:val), len(v:val)]") |
| 493 | let &spellsuggest = spellsuggest_save |
| 494 | return result |
| 495 | endfunc |
| 496 | |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 497 | set spell spellsuggest=expr:MySuggest() |
| 498 | call assert_equal(['BARD', 'BOARD', 'BROAD'], spellsuggest('baord', 3)) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 499 | |
| 500 | new |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 501 | call setline(1, 'baord') |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 502 | let a = execute('norm z=') |
| 503 | call assert_equal( |
| 504 | \ "\n" |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 505 | \ .. "Change \"baord\" to:\n" |
| 506 | \ .. " 1 \"BARD\"\n" |
| 507 | \ .. " 2 \"BOARD\"\n" |
| 508 | \ .. " 3 \"BROAD\"\n" |
Bram Moolenaar | d281b7c | 2020-06-10 16:39:32 +0200 | [diff] [blame] | 509 | \ .. "Type number and <Enter> or click with the mouse (q or empty cancels): ", a) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 510 | |
| 511 | " With verbose, z= should show the score i.e. word length with |
| 512 | " our SpellSuggest() function. |
| 513 | set verbose=1 |
| 514 | let a = execute('norm z=') |
| 515 | call assert_equal( |
| 516 | \ "\n" |
Bram Moolenaar | 7673405 | 2019-12-26 14:30:15 +0100 | [diff] [blame] | 517 | \ .. "Change \"baord\" to:\n" |
| 518 | \ .. " 1 \"BARD\" (4 - 0)\n" |
| 519 | \ .. " 2 \"BOARD\" (5 - 0)\n" |
| 520 | \ .. " 3 \"BROAD\" (5 - 0)\n" |
Bram Moolenaar | d281b7c | 2020-06-10 16:39:32 +0200 | [diff] [blame] | 521 | \ .. "Type number and <Enter> or click with the mouse (q or empty cancels): ", a) |
Bram Moolenaar | e9a8d1f | 2019-12-25 13:36:36 +0100 | [diff] [blame] | 522 | |
| 523 | set spell& spellsuggest& verbose& |
| 524 | bwipe! |
| 525 | endfunc |
| 526 | |
Dominique Pelle | 81b573d | 2022-03-22 21:14:55 +0000 | [diff] [blame] | 527 | " Test for 'spellsuggest' expr errors |
Bram Moolenaar | 8dfcce3 | 2020-03-18 19:32:26 +0100 | [diff] [blame] | 528 | func Test_spellsuggest_expr_errors() |
| 529 | " 'spellsuggest' |
| 530 | func MySuggest() |
| 531 | return range(3) |
| 532 | endfunc |
| 533 | set spell spellsuggest=expr:MySuggest() |
| 534 | call assert_equal([], spellsuggest('baord', 3)) |
| 535 | |
| 536 | " Test for 'spellsuggest' expression returning a non-list value |
| 537 | func! MySuggest2() |
| 538 | return 'good' |
| 539 | endfunc |
| 540 | set spellsuggest=expr:MySuggest2() |
| 541 | call assert_equal([], spellsuggest('baord')) |
| 542 | |
| 543 | " Test for 'spellsuggest' expression returning a list with dict values |
| 544 | func! MySuggest3() |
| 545 | return [[{}, {}]] |
| 546 | endfunc |
| 547 | set spellsuggest=expr:MySuggest3() |
Bram Moolenaar | 9b7bf9e | 2020-07-11 22:14:59 +0200 | [diff] [blame] | 548 | call assert_fails("call spellsuggest('baord')", 'E731:') |
Bram Moolenaar | 8dfcce3 | 2020-03-18 19:32:26 +0100 | [diff] [blame] | 549 | |
| 550 | set nospell spellsuggest& |
| 551 | delfunc MySuggest |
| 552 | delfunc MySuggest2 |
| 553 | delfunc MySuggest3 |
| 554 | endfunc |
| 555 | |
Bram Moolenaar | 585ee07 | 2022-01-29 11:22:17 +0000 | [diff] [blame] | 556 | func Test_spellsuggest_timeout() |
| 557 | set spellsuggest=timeout:30 |
| 558 | set spellsuggest=timeout:-123 |
| 559 | set spellsuggest=timeout:999999 |
| 560 | call assert_fails('set spellsuggest=timeout', 'E474:') |
| 561 | call assert_fails('set spellsuggest=timeout:x', 'E474:') |
| 562 | call assert_fails('set spellsuggest=timeout:-x', 'E474:') |
| 563 | call assert_fails('set spellsuggest=timeout:--9', 'E474:') |
| 564 | endfunc |
| 565 | |
Bram Moolenaar | 5c68617 | 2022-03-13 20:12:25 +0000 | [diff] [blame] | 566 | func Test_spellsuggest_visual_end_of_line() |
| 567 | let enc_save = &encoding |
| 568 | set encoding=iso8859 |
| 569 | |
| 570 | " This was reading beyond the end of the line. |
| 571 | norm R00000000000 |
| 572 | sil norm 0 |
| 573 | sil! norm i00000) |
| 574 | sil! norm i00000) |
| 575 | call feedkeys("\<CR>") |
| 576 | norm z= |
| 577 | |
| 578 | let &encoding = enc_save |
| 579 | endfunc |
| 580 | |
Bram Moolenaar | 9049b68 | 2018-08-31 22:26:53 +0200 | [diff] [blame] | 581 | func Test_spellinfo() |
| 582 | new |
Bram Moolenaar | c25e702 | 2019-10-10 14:08:26 +0200 | [diff] [blame] | 583 | let runtime = substitute($VIMRUNTIME, '\\', '/', 'g') |
Bram Moolenaar | 9049b68 | 2018-08-31 22:26:53 +0200 | [diff] [blame] | 584 | |
| 585 | set enc=latin1 spell spelllang=en |
Bram Moolenaar | c25e702 | 2019-10-10 14:08:26 +0200 | [diff] [blame] | 586 | call assert_match("^\nfile: " .. runtime .. "/spell/en.latin1.spl\n$", execute('spellinfo')) |
Bram Moolenaar | 9049b68 | 2018-08-31 22:26:53 +0200 | [diff] [blame] | 587 | |
| 588 | set enc=cp1250 spell spelllang=en |
Bram Moolenaar | c25e702 | 2019-10-10 14:08:26 +0200 | [diff] [blame] | 589 | call assert_match("^\nfile: " .. runtime .. "/spell/en.ascii.spl\n$", execute('spellinfo')) |
Bram Moolenaar | 9049b68 | 2018-08-31 22:26:53 +0200 | [diff] [blame] | 590 | |
Bram Moolenaar | 30276f2 | 2019-01-24 17:59:39 +0100 | [diff] [blame] | 591 | set enc=utf-8 spell spelllang=en |
Bram Moolenaar | c25e702 | 2019-10-10 14:08:26 +0200 | [diff] [blame] | 592 | call assert_match("^\nfile: " .. runtime .. "/spell/en.utf-8.spl\n$", execute('spellinfo')) |
Bram Moolenaar | 9049b68 | 2018-08-31 22:26:53 +0200 | [diff] [blame] | 593 | |
| 594 | set enc=latin1 spell spelllang=en_us,en_nz |
| 595 | call assert_match("^\n" . |
Bram Moolenaar | c25e702 | 2019-10-10 14:08:26 +0200 | [diff] [blame] | 596 | \ "file: " .. runtime .. "/spell/en.latin1.spl\n" . |
| 597 | \ "file: " .. runtime.. "/spell/en.latin1.spl\n$", execute('spellinfo')) |
Bram Moolenaar | 9049b68 | 2018-08-31 22:26:53 +0200 | [diff] [blame] | 598 | |
| 599 | set spell spelllang= |
| 600 | call assert_fails('spellinfo', 'E756:') |
| 601 | |
| 602 | set nospell spelllang=en |
| 603 | call assert_fails('spellinfo', 'E756:') |
| 604 | |
Bram Moolenaar | 8f130ed | 2019-04-10 22:15:19 +0200 | [diff] [blame] | 605 | call assert_fails('set spelllang=foo/bar', 'E474:') |
| 606 | call assert_fails('set spelllang=foo\ bar', 'E474:') |
| 607 | call assert_fails("set spelllang=foo\\\nbar", 'E474:') |
| 608 | call assert_fails("set spelllang=foo\\\rbar", 'E474:') |
| 609 | call assert_fails("set spelllang=foo+bar", 'E474:') |
| 610 | |
Bram Moolenaar | 9049b68 | 2018-08-31 22:26:53 +0200 | [diff] [blame] | 611 | set enc& spell& spelllang& |
| 612 | bwipe |
| 613 | endfunc |
| 614 | |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 615 | func Test_zz_basic() |
| 616 | call LoadAffAndDic(g:test_data_aff1, g:test_data_dic1) |
| 617 | call RunGoodBad("wrong OK puts. Test the end", |
| 618 | \ "bad: inputs comment ok Ok. test d\xE9\xF4l end the", |
| 619 | \["Comment", "deol", "d\xE9\xF4r", "input", "OK", "output", "outputs", "outtest", "put", "puts", |
| 620 | \ "test", "testen", "testn", "the end", "uk", "wrong"], |
| 621 | \[ |
| 622 | \ ["bad", ["put", "uk", "OK"]], |
| 623 | \ ["inputs", ["input", "puts", "outputs"]], |
| 624 | \ ["comment", ["Comment", "outtest", "the end"]], |
| 625 | \ ["ok", ["OK", "uk", "put"]], |
| 626 | \ ["Ok", ["OK", "Uk", "Put"]], |
| 627 | \ ["test", ["Test", "testn", "testen"]], |
| 628 | \ ["d\xE9\xF4l", ["deol", "d\xE9\xF4r", "test"]], |
| 629 | \ ["end", ["put", "uk", "test"]], |
| 630 | \ ["the", ["put", "uk", "test"]], |
| 631 | \ ] |
| 632 | \ ) |
| 633 | |
| 634 | call assert_equal("gebletegek", soundfold('goobledygoook')) |
Bram Moolenaar | f6ed61e | 2019-09-07 19:05:09 +0200 | [diff] [blame] | 635 | call assert_equal("kepereneven", 'kóopërÿnôven'->soundfold()) |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 636 | call assert_equal("everles gesvets etele", soundfold('oeverloos gezwets edale')) |
| 637 | endfunc |
| 638 | |
| 639 | " Postponed prefixes |
| 640 | func Test_zz_prefixes() |
| 641 | call LoadAffAndDic(g:test_data_aff2, g:test_data_dic1) |
| 642 | call RunGoodBad("puts", |
| 643 | \ "bad: inputs comment ok Ok end the. test d\xE9\xF4l", |
| 644 | \ ["Comment", "deol", "d\xE9\xF4r", "OK", "put", "input", "output", "puts", "outputs", "test", "outtest", "testen", "testn", "the end", "uk", "wrong"], |
| 645 | \ [ |
| 646 | \ ["bad", ["put", "uk", "OK"]], |
| 647 | \ ["inputs", ["input", "puts", "outputs"]], |
| 648 | \ ["comment", ["Comment"]], |
| 649 | \ ["ok", ["OK", "uk", "put"]], |
| 650 | \ ["Ok", ["OK", "Uk", "Put"]], |
| 651 | \ ["end", ["put", "uk", "deol"]], |
| 652 | \ ["the", ["put", "uk", "test"]], |
| 653 | \ ["test", ["Test", "testn", "testen"]], |
| 654 | \ ["d\xE9\xF4l", ["deol", "d\xE9\xF4r", "test"]], |
| 655 | \ ]) |
| 656 | endfunc |
| 657 | |
| 658 | "Compound words |
| 659 | func Test_zz_compound() |
| 660 | call LoadAffAndDic(g:test_data_aff3, g:test_data_dic3) |
| 661 | call RunGoodBad("foo m\xEF foobar foofoobar barfoo barbarfoo", |
| 662 | \ "bad: bar la foom\xEF barm\xEF m\xEFfoo m\xEFbar m\xEFm\xEF lala m\xEFla lam\xEF foola labar", |
| 663 | \ ["foo", "m\xEF"], |
| 664 | \ [ |
| 665 | \ ["bad", ["foo", "m\xEF"]], |
| 666 | \ ["bar", ["barfoo", "foobar", "foo"]], |
| 667 | \ ["la", ["m\xEF", "foo"]], |
| 668 | \ ["foom\xEF", ["foo m\xEF", "foo", "foofoo"]], |
| 669 | \ ["barm\xEF", ["barfoo", "m\xEF", "barbar"]], |
| 670 | \ ["m\xEFfoo", ["m\xEF foo", "foo", "foofoo"]], |
| 671 | \ ["m\xEFbar", ["foobar", "barbar", "m\xEF"]], |
| 672 | \ ["m\xEFm\xEF", ["m\xEF m\xEF", "m\xEF"]], |
| 673 | \ ["lala", []], |
| 674 | \ ["m\xEFla", ["m\xEF", "m\xEF m\xEF"]], |
| 675 | \ ["lam\xEF", ["m\xEF", "m\xEF m\xEF"]], |
| 676 | \ ["foola", ["foo", "foobar", "foofoo"]], |
| 677 | \ ["labar", ["barbar", "foobar"]], |
| 678 | \ ]) |
| 679 | |
| 680 | call LoadAffAndDic(g:test_data_aff4, g:test_data_dic4) |
| 681 | call RunGoodBad("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", |
| 682 | \ "bad: wordutilize pro borkborkborkborkborkbork tomatotomatotomato endstart endend startstart wordend wordstart preborkprebork preborkpreborkbork startwordwordwordwordend borkpreborkpreborkbork utilsbork startnouword", |
| 683 | \ ["bork", "prebork", "end", "pro-ok", "start", "tomato", "util", "utilize", "utils", "word", "nouword"], |
| 684 | \ [ |
| 685 | \ ["bad", ["end", "bork", "word"]], |
| 686 | \ ["wordutilize", ["word utilize", "wordutils", "wordutil"]], |
| 687 | \ ["pro", ["bork", "word", "end"]], |
| 688 | \ ["borkborkborkborkborkbork", ["bork borkborkborkborkbork", "borkbork borkborkborkbork", "borkborkbork borkborkbork"]], |
| 689 | \ ["tomatotomatotomato", ["tomato tomatotomato", "tomatotomato tomato", "tomato tomato tomato"]], |
| 690 | \ ["endstart", ["end start", "start"]], |
| 691 | \ ["endend", ["end end", "end"]], |
| 692 | \ ["startstart", ["start start"]], |
| 693 | \ ["wordend", ["word end", "word", "wordword"]], |
| 694 | \ ["wordstart", ["word start", "bork start"]], |
| 695 | \ ["preborkprebork", ["prebork prebork", "preborkbork", "preborkborkbork"]], |
| 696 | \ ["preborkpreborkbork", ["prebork preborkbork", "preborkborkbork", "preborkborkborkbork"]], |
| 697 | \ ["startwordwordwordwordend", ["startwordwordwordword end", "startwordwordwordword", "start wordwordwordword end"]], |
| 698 | \ ["borkpreborkpreborkbork", ["bork preborkpreborkbork", "bork prebork preborkbork", "bork preborkprebork bork"]], |
| 699 | \ ["utilsbork", ["utilbork", "utils bork", "util bork"]], |
| 700 | \ ["startnouword", ["start nouword", "startword", "startborkword"]], |
| 701 | \ ]) |
| 702 | |
| 703 | endfunc |
| 704 | |
| 705 | "Test affix flags with two characters |
| 706 | func Test_zz_affix() |
| 707 | call LoadAffAndDic(g:test_data_aff5, g:test_data_dic5) |
| 708 | call RunGoodBad("fooa1 fooa\xE9 bar prebar barbork prebarbork startprebar start end startend startmiddleend nouend", |
| 709 | \ "bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart startprobar startnouend", |
| 710 | \ ["bar", "barbork", "end", "fooa1", "fooa\xE9", "nouend", "prebar", "prebarbork", "start"], |
| 711 | \ [ |
| 712 | \ ["bad", ["bar", "end", "fooa1"]], |
| 713 | \ ["foo", ["fooa1", "fooa\xE9", "bar"]], |
| 714 | \ ["fooa2", ["fooa1", "fooa\xE9", "bar"]], |
| 715 | \ ["prabar", ["prebar", "bar", "bar bar"]], |
| 716 | \ ["probarbirk", ["prebarbork"]], |
| 717 | \ ["middle", []], |
| 718 | \ ["startmiddle", ["startmiddleend", "startmiddlebar"]], |
| 719 | \ ["middleend", []], |
| 720 | \ ["endstart", ["end start", "start"]], |
| 721 | \ ["startprobar", ["startprebar", "start prebar", "startbar"]], |
| 722 | \ ["startnouend", ["start nouend", "startend"]], |
| 723 | \ ]) |
| 724 | |
| 725 | call LoadAffAndDic(g:test_data_aff6, g:test_data_dic6) |
| 726 | call RunGoodBad("meea1 meea\xE9 bar prebar barbork prebarbork leadprebar lead end leadend leadmiddleend", |
| 727 | \ "bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead leadprobar", |
| 728 | \ ["bar", "barbork", "end", "lead", "meea1", "meea\xE9", "prebar", "prebarbork"], |
| 729 | \ [ |
| 730 | \ ["bad", ["bar", "end", "lead"]], |
| 731 | \ ["mee", ["meea1", "meea\xE9", "bar"]], |
| 732 | \ ["meea2", ["meea1", "meea\xE9", "lead"]], |
| 733 | \ ["prabar", ["prebar", "bar", "leadbar"]], |
| 734 | \ ["probarbirk", ["prebarbork"]], |
| 735 | \ ["middle", []], |
| 736 | \ ["leadmiddle", ["leadmiddleend", "leadmiddlebar"]], |
| 737 | \ ["middleend", []], |
| 738 | \ ["endlead", ["end lead", "lead", "end end"]], |
| 739 | \ ["leadprobar", ["leadprebar", "lead prebar", "leadbar"]], |
| 740 | \ ]) |
| 741 | |
| 742 | call LoadAffAndDic(g:test_data_aff7, g:test_data_dic7) |
Bram Moolenaar | 3d2a47c | 2019-11-07 20:48:42 +0100 | [diff] [blame] | 743 | call RunGoodBad("meea1 meezero meea\xE9 bar prebar barmeat prebarmeat leadprebar lead tail leadtail leadmiddletail", |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 744 | \ "bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead leadprobar", |
Bram Moolenaar | 3d2a47c | 2019-11-07 20:48:42 +0100 | [diff] [blame] | 745 | \ ["bar", "barmeat", "lead", "meea1", "meea\xE9", "meezero", "prebar", "prebarmeat", "tail"], |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 746 | \ [ |
| 747 | \ ["bad", ["bar", "lead", "tail"]], |
| 748 | \ ["mee", ["meea1", "meea\xE9", "bar"]], |
| 749 | \ ["meea2", ["meea1", "meea\xE9", "lead"]], |
| 750 | \ ["prabar", ["prebar", "bar", "leadbar"]], |
| 751 | \ ["probarmaat", ["prebarmeat"]], |
| 752 | \ ["middle", []], |
| 753 | \ ["leadmiddle", ["leadmiddlebar"]], |
| 754 | \ ["middletail", []], |
| 755 | \ ["taillead", ["tail lead", "tail"]], |
| 756 | \ ["leadprobar", ["leadprebar", "lead prebar", "leadbar"]], |
| 757 | \ ]) |
| 758 | endfunc |
| 759 | |
| 760 | func Test_zz_NOSLITSUGS() |
| 761 | call LoadAffAndDic(g:test_data_aff8, g:test_data_dic8) |
| 762 | call RunGoodBad("foo bar faabar", "bad: foobar barfoo", |
| 763 | \ ["bar", "faabar", "foo"], |
| 764 | \ [ |
| 765 | \ ["bad", ["bar", "foo"]], |
| 766 | \ ["foobar", ["faabar", "foo bar", "bar"]], |
| 767 | \ ["barfoo", ["bar foo", "bar", "foo"]], |
| 768 | \ ]) |
| 769 | endfunc |
| 770 | |
| 771 | " Numbers |
| 772 | func Test_zz_Numbers() |
| 773 | call LoadAffAndDic(g:test_data_aff9, g:test_data_dic9) |
| 774 | call RunGoodBad("0b1011 0777 1234 0x01ff", "", |
| 775 | \ ["bar", "foo"], |
| 776 | \ [ |
| 777 | \ ]) |
| 778 | endfunc |
| 779 | |
Bram Moolenaar | 37ff4cf | 2019-11-17 20:10:20 +0100 | [diff] [blame] | 780 | " Affix flags |
| 781 | func Test_zz_affix_flags() |
| 782 | call LoadAffAndDic(g:test_data_aff10, g:test_data_dic10) |
| 783 | call RunGoodBad("drink drinkable drinkables drinktable drinkabletable", |
| 784 | \ "bad: drinks drinkstable drinkablestable", |
| 785 | \ ["drink", "drinkable", "drinkables", "table"], |
| 786 | \ [['bad', []], |
| 787 | \ ['drinks', ['drink']], |
| 788 | \ ['drinkstable', ['drinktable', 'drinkable', 'drink table']], |
| 789 | \ ['drinkablestable', ['drinkabletable', 'drinkables table', 'drinkable table']], |
| 790 | \ ]) |
| 791 | endfunc |
| 792 | |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 793 | function FirstSpellWord() |
| 794 | call feedkeys("/^start:\n", 'tx') |
| 795 | normal ]smm |
| 796 | let [str, a] = spellbadword() |
| 797 | return str |
| 798 | endfunc |
| 799 | |
| 800 | function SecondSpellWord() |
| 801 | normal `m]s |
| 802 | let [str, a] = spellbadword() |
| 803 | return str |
| 804 | endfunc |
| 805 | |
| 806 | "Test with SAL instead of SOFO items; test automatic reloading |
| 807 | func Test_zz_sal_and_addition() |
| 808 | set enc=latin1 |
| 809 | set spellfile= |
Bram Moolenaar | 5656496 | 2022-10-10 22:39:42 +0100 | [diff] [blame] | 810 | call writefile(g:test_data_dic1, "Xtest.dic", 'D') |
| 811 | call writefile(g:test_data_aff_sal, "Xtest.aff", 'D') |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 812 | mkspell! Xtest Xtest |
| 813 | set spl=Xtest.latin1.spl spell |
| 814 | call assert_equal('kbltykk', soundfold('goobledygoook')) |
| 815 | call assert_equal('kprnfn', soundfold('kóopërÿnôven')) |
| 816 | call assert_equal('*fls kswts tl', soundfold('oeverloos gezwets edale')) |
| 817 | |
| 818 | "also use an addition file |
Bram Moolenaar | 5656496 | 2022-10-10 22:39:42 +0100 | [diff] [blame] | 819 | call writefile(["/regions=usgbnz", "elequint/2", "elekwint/3"], "Xtest.latin1.add", 'D') |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 820 | mkspell! Xtest.latin1.add.spl Xtest.latin1.add |
| 821 | |
| 822 | bwipe! |
| 823 | call setline(1, ["start: elequint test elekwint test elekwent asdf"]) |
| 824 | |
| 825 | set spellfile=Xtest.latin1.add |
| 826 | call assert_equal("elekwent", FirstSpellWord()) |
| 827 | |
| 828 | set spl=Xtest_us.latin1.spl |
| 829 | call assert_equal("elequint", FirstSpellWord()) |
| 830 | call assert_equal("elekwint", SecondSpellWord()) |
| 831 | |
| 832 | set spl=Xtest_gb.latin1.spl |
| 833 | call assert_equal("elekwint", FirstSpellWord()) |
| 834 | call assert_equal("elekwent", SecondSpellWord()) |
| 835 | |
| 836 | set spl=Xtest_nz.latin1.spl |
| 837 | call assert_equal("elequint", FirstSpellWord()) |
| 838 | call assert_equal("elekwent", SecondSpellWord()) |
| 839 | |
| 840 | set spl=Xtest_ca.latin1.spl |
| 841 | call assert_equal("elequint", FirstSpellWord()) |
| 842 | call assert_equal("elekwint", SecondSpellWord()) |
zeertzjq | 288ed23 | 2022-07-04 11:03:07 +0100 | [diff] [blame] | 843 | |
| 844 | bwipe! |
| 845 | set spellfile= |
| 846 | set spl& |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 847 | endfunc |
| 848 | |
Bram Moolenaar | 862f1e1 | 2019-04-10 22:33:41 +0200 | [diff] [blame] | 849 | func Test_spellfile_value() |
| 850 | set spellfile=Xdir/Xtest.latin1.add |
| 851 | set spellfile=Xdir/Xtest.utf-8.add,Xtest_other.add |
| 852 | endfunc |
| 853 | |
Bram Moolenaar | ee03b94 | 2017-10-27 00:57:05 +0200 | [diff] [blame] | 854 | func Test_region_error() |
| 855 | messages clear |
Bram Moolenaar | 5656496 | 2022-10-10 22:39:42 +0100 | [diff] [blame] | 856 | call writefile(["/regions=usgbnz", "elequint/0"], "Xtest.latin1.add", 'D') |
Bram Moolenaar | ee03b94 | 2017-10-27 00:57:05 +0200 | [diff] [blame] | 857 | mkspell! Xtest.latin1.add.spl Xtest.latin1.add |
| 858 | call assert_match('Invalid region nr in Xtest.latin1.add line 2: 0', execute('messages')) |
Bram Moolenaar | ee03b94 | 2017-10-27 00:57:05 +0200 | [diff] [blame] | 859 | call delete('Xtest.latin1.add.spl') |
| 860 | endfunc |
| 861 | |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 862 | " Check using z= in new buffer (crash fixed by patch 7.4a.028). |
| 863 | func Test_zeq_crash() |
| 864 | new |
| 865 | set maxmem=512 spell |
| 866 | call feedkeys('iasdz=:\"', 'tx') |
| 867 | |
| 868 | bwipe! |
| 869 | endfunc |
| 870 | |
Bram Moolenaar | 152e79e | 2020-06-10 15:32:08 +0200 | [diff] [blame] | 871 | " Check that z= works even when 'nospell' is set. This test uses one of the |
| 872 | " tests in Test_spellsuggest_option_number() just to verify that z= basically |
| 873 | " works and that "E756: Spell checking is not enabled" is not generated. |
| 874 | func Test_zeq_nospell() |
| 875 | new |
| 876 | set nospell spellsuggest=1,best |
| 877 | call setline(1, 'A baord') |
| 878 | try |
| 879 | norm $1z= |
| 880 | call assert_equal('A board', getline(1)) |
| 881 | catch |
| 882 | call assert_report("Caught exception: " . v:exception) |
| 883 | endtry |
| 884 | set spell& spellsuggest& |
| 885 | bwipe! |
| 886 | endfunc |
| 887 | |
| 888 | " Check that "E756: Spell checking is not possible" is reported when z= is |
| 889 | " executed and 'spelllang' is empty. |
| 890 | func Test_zeq_no_spelllang() |
| 891 | new |
| 892 | set spelllang= spellsuggest=1,best |
| 893 | call setline(1, 'A baord') |
| 894 | call assert_fails('normal $1z=', 'E756:') |
| 895 | set spelllang& spellsuggest& |
| 896 | bwipe! |
| 897 | endfunc |
| 898 | |
Bram Moolenaar | 5bcc5a1 | 2019-08-06 22:48:02 +0200 | [diff] [blame] | 899 | " Check handling a word longer than MAXWLEN. |
| 900 | func Test_spell_long_word() |
| 901 | set enc=utf-8 |
| 902 | new |
| 903 | call setline(1, "d\xCC\xB4\xCC\xBD\xCD\x88\xCD\x94a\xCC\xB5\xCD\x84\xCD\x84\xCC\xA8\xCD\x9Cr\xCC\xB5\xCC\x8E\xCD\x85\xCD\x85k\xCC\xB6\xCC\x89\xCC\x9D \xCC\xB6\xCC\x83\xCC\x8F\xCC\xA4\xCD\x8Ef\xCC\xB7\xCC\x81\xCC\x80\xCC\xA9\xCC\xB0\xCC\xAC\xCC\xA2\xCD\x95\xCD\x87\xCD\x8D\xCC\x9E\xCD\x99\xCC\xAD\xCC\xAB\xCC\x97\xCC\xBBo\xCC\xB6\xCC\x84\xCC\x95\xCC\x8C\xCC\x8B\xCD\x9B\xCD\x9C\xCC\xAFr\xCC\xB7\xCC\x94\xCD\x83\xCD\x97\xCC\x8C\xCC\x82\xCD\x82\xCD\x80\xCD\x91\xCC\x80\xCC\xBE\xCC\x82\xCC\x8F\xCC\xA3\xCD\x85\xCC\xAE\xCD\x8D\xCD\x99\xCC\xBC\xCC\xAB\xCC\xA7\xCD\x88c\xCC\xB7\xCD\x83\xCC\x84\xCD\x92\xCC\x86\xCC\x83\xCC\x88\xCC\x92\xCC\x94\xCC\xBE\xCC\x9D\xCC\xAF\xCC\x98\xCC\x9D\xCC\xBB\xCD\x8E\xCC\xBB\xCC\xB3\xCC\xA3\xCD\x8E\xCD\x99\xCC\xA5\xCC\xAD\xCC\x99\xCC\xB9\xCC\xAE\xCC\xA5\xCC\x9E\xCD\x88\xCC\xAE\xCC\x9E\xCC\xA9\xCC\x97\xCC\xBC\xCC\x99\xCC\xA5\xCD\x87\xCC\x97\xCD\x8E\xCD\x94\xCC\x99\xCC\x9D\xCC\x96\xCD\x94\xCC\xAB\xCC\xA7\xCC\xA5\xCC\x98\xCC\xBB\xCC\xAF\xCC\xABe\xCC\xB7\xCC\x8E\xCC\x82\xCD\x86\xCD\x9B\xCC\x94\xCD\x83\xCC\x85\xCD\x8A\xCD\x8C\xCC\x8B\xCD\x92\xCD\x91\xCC\x8F\xCC\x81\xCD\x95\xCC\xA2\xCC\xB9\xCC\xB2\xCD\x9C\xCC\xB1\xCC\xA6\xCC\xB3\xCC\xAF\xCC\xAE\xCC\x9C\xCD\x99s\xCC\xB8\xCC\x8C\xCC\x8E\xCC\x87\xCD\x81\xCD\x82\xCC\x86\xCD\x8C\xCD\x8C\xCC\x8B\xCC\x84\xCC\x8C\xCD\x84\xCD\x9B\xCD\x86\xCC\x93\xCD\x90\xCC\x85\xCC\x94\xCD\x98\xCD\x84\xCD\x92\xCD\x8B\xCC\x90\xCC\x83\xCC\x8F\xCD\x84\xCD\x81\xCD\x9B\xCC\x90\xCD\x81\xCC\x8F\xCC\xBD\xCC\x88\xCC\xBF\xCC\x88\xCC\x84\xCC\x8E\xCD\x99\xCD\x94\xCC\x99\xCD\x99\xCC\xB0\xCC\xA8\xCC\xA3\xCC\xA8\xCC\x96\xCC\x99\xCC\xAE\xCC\xBC\xCC\x99\xCD\x9A\xCC\xB2\xCC\xB1\xCC\x9F\xCC\xBB\xCC\xA6\xCD\x85\xCC\xAA\xCD\x89\xCC\x9D\xCC\x99\xCD\x96\xCC\xB1\xCC\xB1\xCC\x99\xCC\xA6\xCC\xA5\xCD\x95\xCC\xB2\xCC\xA0\xCD\x99 within") |
| 904 | set spell spelllang=en |
| 905 | redraw |
| 906 | redraw! |
| 907 | bwipe! |
| 908 | set nospell |
| 909 | endfunc |
| 910 | |
Bram Moolenaar | 06f1541 | 2022-01-29 10:51:59 +0000 | [diff] [blame] | 911 | func Test_spellsuggest_too_deep() |
| 912 | " This was incrementing "depth" over MAXWLEN. |
| 913 | new |
| 914 | norm s000G00ý000000000000 |
| 915 | sil norm ..vzG................vvzG0 v z= |
| 916 | bwipe! |
| 917 | endfunc |
| 918 | |
Bram Moolenaar | 5e59ea5 | 2022-07-01 22:26:20 +0100 | [diff] [blame] | 919 | func Test_spell_good_word_invalid() |
| 920 | " This was adding a word with a 0x02 byte, which causes havoc. |
| 921 | enew |
| 922 | norm o0 |
| 923 | sil! norm rzzWs00/ |
| 924 | 2 |
| 925 | sil! norm VzGprzzW |
| 926 | sil! norm z= |
| 927 | |
| 928 | bwipe! |
Bram Moolenaar | 5e59ea5 | 2022-07-01 22:26:20 +0100 | [diff] [blame] | 929 | endfunc |
| 930 | |
K.Takata | 2ebcc35 | 2022-07-14 17:25:14 +0100 | [diff] [blame] | 931 | func Test_spell_good_word_slash() |
| 932 | " This caused E1280. |
| 933 | new |
| 934 | norm afoo / |
| 935 | 1 |
| 936 | norm zG |
| 937 | |
| 938 | bwipe! |
| 939 | endfunc |
| 940 | |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 941 | func LoadAffAndDic(aff_contents, dic_contents) |
| 942 | set enc=latin1 |
| 943 | set spellfile= |
| 944 | call writefile(a:aff_contents, "Xtest.aff") |
| 945 | call writefile(a:dic_contents, "Xtest.dic") |
| 946 | " Generate a .spl file from a .dic and .aff file. |
| 947 | mkspell! Xtest Xtest |
| 948 | " use that spell file |
| 949 | set spl=Xtest.latin1.spl spell |
| 950 | endfunc |
| 951 | |
| 952 | func ListWords() |
| 953 | spelldump |
| 954 | %yank |
| 955 | quit |
| 956 | return split(@", "\n") |
| 957 | endfunc |
| 958 | |
| 959 | func TestGoodBadBase() |
| 960 | exe '1;/^good:' |
| 961 | normal 0f:]s |
| 962 | let prevbad = '' |
| 963 | let result = [] |
| 964 | while 1 |
| 965 | let [bad, a] = spellbadword() |
| 966 | if bad == '' || bad == prevbad || bad == 'badend' |
| 967 | break |
| 968 | endif |
| 969 | let prevbad = bad |
Bram Moolenaar | f6ed61e | 2019-09-07 19:05:09 +0200 | [diff] [blame] | 970 | let lst = bad->spellsuggest(3) |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 971 | normal mm |
| 972 | |
| 973 | call add(result, [bad, lst]) |
| 974 | normal `m]s |
| 975 | endwhile |
| 976 | return result |
| 977 | endfunc |
| 978 | |
| 979 | func RunGoodBad(good, bad, expected_words, expected_bad_words) |
| 980 | bwipe! |
| 981 | call setline(1, ["good: ", a:good, a:bad, " badend "]) |
| 982 | let words = ListWords() |
| 983 | call assert_equal(a:expected_words, words[1:-1]) |
| 984 | let bad_words = TestGoodBadBase() |
| 985 | call assert_equal(a:expected_bad_words, bad_words) |
| 986 | bwipe! |
| 987 | endfunc |
| 988 | |
Bram Moolenaar | 7751d1d | 2019-10-18 20:37:08 +0200 | [diff] [blame] | 989 | func Test_spell_screendump() |
| 990 | CheckScreendump |
| 991 | |
| 992 | let lines =<< trim END |
Luuk van Baal | e84c773 | 2023-05-31 18:57:36 +0100 | [diff] [blame] | 993 | call test_override('alloc_lines', 1) |
Bram Moolenaar | 7751d1d | 2019-10-18 20:37:08 +0200 | [diff] [blame] | 994 | call setline(1, [ |
| 995 | \ "This is some text without any spell errors. Everything", |
| 996 | \ "should just be black, nothing wrong here.", |
| 997 | \ "", |
| 998 | \ "This line has a sepll error. and missing caps.", |
| 999 | \ "And and this is the the duplication.", |
| 1000 | \ "with missing caps here.", |
| 1001 | \ ]) |
| 1002 | set spell spelllang=en_nz |
| 1003 | END |
Bram Moolenaar | f3ef026 | 2022-10-05 13:29:15 +0100 | [diff] [blame] | 1004 | call writefile(lines, 'XtestSpell', 'D') |
Bram Moolenaar | 7751d1d | 2019-10-18 20:37:08 +0200 | [diff] [blame] | 1005 | let buf = RunVimInTerminal('-S XtestSpell', {'rows': 8}) |
| 1006 | call VerifyScreenDump(buf, 'Test_spell_1', {}) |
| 1007 | |
| 1008 | " clean up |
| 1009 | call StopVimInTerminal(buf) |
Bram Moolenaar | 7751d1d | 2019-10-18 20:37:08 +0200 | [diff] [blame] | 1010 | endfunc |
| 1011 | |
Christian Brabandt | afa23d1 | 2022-08-09 12:25:10 +0100 | [diff] [blame] | 1012 | func Test_spell_screendump_spellcap() |
| 1013 | CheckScreendump |
| 1014 | |
| 1015 | let lines =<< trim END |
Luuk van Baal | e84c773 | 2023-05-31 18:57:36 +0100 | [diff] [blame] | 1016 | call test_override('alloc_lines', 1) |
Christian Brabandt | afa23d1 | 2022-08-09 12:25:10 +0100 | [diff] [blame] | 1017 | call setline(1, [ |
| 1018 | \ " This line has a sepll error. and missing caps and trailing spaces. ", |
| 1019 | \ "another missing cap here.", |
| 1020 | \ "", |
| 1021 | \ "and here.", |
| 1022 | \ " ", |
| 1023 | \ "and here." |
| 1024 | \ ]) |
| 1025 | set spell spelllang=en |
| 1026 | END |
Bram Moolenaar | f3ef026 | 2022-10-05 13:29:15 +0100 | [diff] [blame] | 1027 | call writefile(lines, 'XtestSpellCap', 'D') |
Christian Brabandt | afa23d1 | 2022-08-09 12:25:10 +0100 | [diff] [blame] | 1028 | let buf = RunVimInTerminal('-S XtestSpellCap', {'rows': 8}) |
| 1029 | call VerifyScreenDump(buf, 'Test_spell_2', {}) |
| 1030 | |
Bram Moolenaar | ee09fcc | 2022-09-25 20:58:30 +0100 | [diff] [blame] | 1031 | " After adding word missing Cap in next line is updated |
| 1032 | call term_sendkeys(buf, "3GANot\<Esc>") |
| 1033 | call VerifyScreenDump(buf, 'Test_spell_3', {}) |
| 1034 | |
Bram Moolenaar | 26f09ea | 2022-09-27 16:29:38 +0100 | [diff] [blame] | 1035 | " Deleting a full stop removes missing Cap in next line |
Luuk van Baal | 2ac6497 | 2023-05-25 17:14:42 +0100 | [diff] [blame] | 1036 | call term_sendkeys(buf, "5Gdd\<C-L>k$x") |
Bram Moolenaar | 26f09ea | 2022-09-27 16:29:38 +0100 | [diff] [blame] | 1037 | call VerifyScreenDump(buf, 'Test_spell_4', {}) |
| 1038 | |
| 1039 | " Undo also updates the next line (go to command line to remove message) |
| 1040 | call term_sendkeys(buf, "u:\<Esc>") |
| 1041 | call VerifyScreenDump(buf, 'Test_spell_5', {}) |
| 1042 | |
Luuk van Baal | 2ac6497 | 2023-05-25 17:14:42 +0100 | [diff] [blame] | 1043 | " Folding an empty line does not remove Cap in next line |
| 1044 | call term_sendkeys(buf, "uzfk:\<Esc>") |
| 1045 | call VerifyScreenDump(buf, 'Test_spell_6', {}) |
| 1046 | |
| 1047 | " Folding the end of a sentence does not remove Cap in next line |
| 1048 | " and editing a line does not remove Cap in current line |
| 1049 | call term_sendkeys(buf, "Jzfkk$x") |
| 1050 | call VerifyScreenDump(buf, 'Test_spell_7', {}) |
| 1051 | |
| 1052 | " Cap is correctly applied in the first row of a window |
| 1053 | call term_sendkeys(buf, "\<C-E>\<C-L>") |
| 1054 | call VerifyScreenDump(buf, 'Test_spell_8', {}) |
| 1055 | |
Luuk van Baal | e84c773 | 2023-05-31 18:57:36 +0100 | [diff] [blame] | 1056 | " Adding an empty line does not remove Cap in "mod_bot" area |
| 1057 | call term_sendkeys(buf, "zbO\<Esc>") |
| 1058 | call VerifyScreenDump(buf, 'Test_spell_9', {}) |
| 1059 | |
| 1060 | " Multiple empty lines does not remove Cap in the line after |
| 1061 | call term_sendkeys(buf, "O\<Esc>\<C-L>") |
| 1062 | call VerifyScreenDump(buf, 'Test_spell_10', {}) |
| 1063 | |
Christian Brabandt | afa23d1 | 2022-08-09 12:25:10 +0100 | [diff] [blame] | 1064 | " clean up |
| 1065 | call StopVimInTerminal(buf) |
Bram Moolenaar | f3ef026 | 2022-10-05 13:29:15 +0100 | [diff] [blame] | 1066 | endfunc |
| 1067 | |
| 1068 | func Test_spell_compatible() |
| 1069 | CheckScreendump |
| 1070 | |
| 1071 | let lines =<< trim END |
Luuk van Baal | e84c773 | 2023-05-31 18:57:36 +0100 | [diff] [blame] | 1072 | call test_override('alloc_lines', 1) |
Bram Moolenaar | f3ef026 | 2022-10-05 13:29:15 +0100 | [diff] [blame] | 1073 | call setline(1, [ |
| 1074 | \ "test "->repeat(20), |
| 1075 | \ "", |
| 1076 | \ "end", |
| 1077 | \ ]) |
| 1078 | set spell cpo+=$ |
| 1079 | END |
| 1080 | call writefile(lines, 'XtestSpellComp', 'D') |
| 1081 | let buf = RunVimInTerminal('-S XtestSpellComp', {'rows': 8}) |
| 1082 | |
| 1083 | call term_sendkeys(buf, "51|C") |
| 1084 | call VerifyScreenDump(buf, 'Test_spell_compatible_1', {}) |
| 1085 | |
| 1086 | call term_sendkeys(buf, "x") |
| 1087 | call VerifyScreenDump(buf, 'Test_spell_compatible_2', {}) |
| 1088 | |
| 1089 | " clean up |
| 1090 | call StopVimInTerminal(buf) |
Christian Brabandt | afa23d1 | 2022-08-09 12:25:10 +0100 | [diff] [blame] | 1091 | endfunc |
| 1092 | |
Christian Brabandt | 73b2d37 | 2023-11-14 21:58:26 +0100 | [diff] [blame] | 1093 | func Test_z_equal_with_large_count() |
| 1094 | split |
| 1095 | set spell |
| 1096 | call setline(1, "ff") |
| 1097 | norm 0z=337203685477580 |
| 1098 | set nospell |
| 1099 | bwipe! |
| 1100 | endfunc |
| 1101 | |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 1102 | let g:test_data_aff1 = [ |
| 1103 | \"SET ISO8859-1", |
| 1104 | \"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ", |
| 1105 | \"", |
| 1106 | \"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", |
| 1107 | \"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", |
| 1108 | \"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", |
| 1109 | \"", |
| 1110 | \"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", |
| 1111 | \"SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep?", |
| 1112 | \"", |
| 1113 | \"MIDWORD\t'-", |
| 1114 | \"", |
| 1115 | \"KEP =", |
| 1116 | \"RAR ?", |
| 1117 | \"BAD !", |
| 1118 | \"", |
| 1119 | \"PFX I N 1", |
| 1120 | \"PFX I 0 in .", |
| 1121 | \"", |
| 1122 | \"PFX O Y 1", |
| 1123 | \"PFX O 0 out .", |
| 1124 | \"", |
| 1125 | \"SFX S Y 2", |
| 1126 | \"SFX S 0 s [^s]", |
| 1127 | \"SFX S 0 es s", |
| 1128 | \"", |
| 1129 | \"SFX N N 3", |
| 1130 | \"SFX N 0 en [^n]", |
| 1131 | \"SFX N 0 nen n", |
| 1132 | \"SFX N 0 n .", |
| 1133 | \"", |
| 1134 | \"REP 3", |
| 1135 | \"REP g ch", |
| 1136 | \"REP ch g", |
| 1137 | \"REP svp s.v.p.", |
| 1138 | \"", |
| 1139 | \"MAP 9", |
| 1140 | \"MAP a\xE0\xE1\xE2\xE3\xE4\xE5", |
| 1141 | \"MAP e\xE8\xE9\xEA\xEB", |
| 1142 | \"MAP i\xEC\xED\xEE\xEF", |
| 1143 | \"MAP o\xF2\xF3\xF4\xF5\xF6", |
| 1144 | \"MAP u\xF9\xFA\xFB\xFC", |
| 1145 | \"MAP n\xF1", |
| 1146 | \"MAP c\xE7", |
| 1147 | \"MAP y\xFF\xFD", |
| 1148 | \"MAP s\xDF", |
| 1149 | \ ] |
| 1150 | let g:test_data_dic1 = [ |
| 1151 | \"123456", |
| 1152 | \"test/NO", |
| 1153 | \"# comment", |
| 1154 | \"wrong", |
| 1155 | \"Comment", |
| 1156 | \"OK", |
| 1157 | \"uk", |
| 1158 | \"put/ISO", |
| 1159 | \"the end", |
| 1160 | \"deol", |
| 1161 | \"d\xE9\xF4r", |
| 1162 | \ ] |
| 1163 | let g:test_data_aff2 = [ |
| 1164 | \"SET ISO8859-1", |
| 1165 | \"", |
| 1166 | \"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", |
| 1167 | \"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", |
| 1168 | \"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", |
| 1169 | \"", |
| 1170 | \"PFXPOSTPONE", |
| 1171 | \"", |
| 1172 | \"MIDWORD\t'-", |
| 1173 | \"", |
| 1174 | \"KEP =", |
| 1175 | \"RAR ?", |
| 1176 | \"BAD !", |
| 1177 | \"", |
| 1178 | \"PFX I N 1", |
| 1179 | \"PFX I 0 in .", |
| 1180 | \"", |
| 1181 | \"PFX O Y 1", |
| 1182 | \"PFX O 0 out [a-z]", |
| 1183 | \"", |
| 1184 | \"SFX S Y 2", |
| 1185 | \"SFX S 0 s [^s]", |
| 1186 | \"SFX S 0 es s", |
| 1187 | \"", |
| 1188 | \"SFX N N 3", |
| 1189 | \"SFX N 0 en [^n]", |
| 1190 | \"SFX N 0 nen n", |
| 1191 | \"SFX N 0 n .", |
| 1192 | \"", |
| 1193 | \"REP 3", |
| 1194 | \"REP g ch", |
| 1195 | \"REP ch g", |
| 1196 | \"REP svp s.v.p.", |
| 1197 | \"", |
| 1198 | \"MAP 9", |
| 1199 | \"MAP a\xE0\xE1\xE2\xE3\xE4\xE5", |
| 1200 | \"MAP e\xE8\xE9\xEA\xEB", |
| 1201 | \"MAP i\xEC\xED\xEE\xEF", |
| 1202 | \"MAP o\xF2\xF3\xF4\xF5\xF6", |
| 1203 | \"MAP u\xF9\xFA\xFB\xFC", |
| 1204 | \"MAP n\xF1", |
| 1205 | \"MAP c\xE7", |
| 1206 | \"MAP y\xFF\xFD", |
| 1207 | \"MAP s\xDF", |
| 1208 | \ ] |
| 1209 | let g:test_data_aff3 = [ |
| 1210 | \"SET ISO8859-1", |
| 1211 | \"", |
| 1212 | \"COMPOUNDMIN 3", |
| 1213 | \"COMPOUNDRULE m*", |
| 1214 | \"NEEDCOMPOUND x", |
| 1215 | \ ] |
| 1216 | let g:test_data_dic3 = [ |
| 1217 | \"1234", |
| 1218 | \"foo/m", |
| 1219 | \"bar/mx", |
| 1220 | \"m\xEF/m", |
| 1221 | \"la/mx", |
| 1222 | \ ] |
| 1223 | let g:test_data_aff4 = [ |
| 1224 | \"SET ISO8859-1", |
| 1225 | \"", |
| 1226 | \"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", |
| 1227 | \"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", |
| 1228 | \"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", |
| 1229 | \"", |
| 1230 | \"COMPOUNDRULE m+", |
| 1231 | \"COMPOUNDRULE sm*e", |
| 1232 | \"COMPOUNDRULE sm+", |
| 1233 | \"COMPOUNDMIN 3", |
| 1234 | \"COMPOUNDWORDMAX 3", |
| 1235 | \"COMPOUNDFORBIDFLAG t", |
| 1236 | \"", |
| 1237 | \"COMPOUNDSYLMAX 5", |
| 1238 | \"SYLLABLE a\xE1e\xE9i\xEDo\xF3\xF6\xF5u\xFA\xFC\xFBy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui", |
| 1239 | \"", |
| 1240 | \"MAP 9", |
| 1241 | \"MAP a\xE0\xE1\xE2\xE3\xE4\xE5", |
| 1242 | \"MAP e\xE8\xE9\xEA\xEB", |
| 1243 | \"MAP i\xEC\xED\xEE\xEF", |
| 1244 | \"MAP o\xF2\xF3\xF4\xF5\xF6", |
| 1245 | \"MAP u\xF9\xFA\xFB\xFC", |
| 1246 | \"MAP n\xF1", |
| 1247 | \"MAP c\xE7", |
| 1248 | \"MAP y\xFF\xFD", |
| 1249 | \"MAP s\xDF", |
| 1250 | \"", |
| 1251 | \"NEEDAFFIX x", |
| 1252 | \"", |
| 1253 | \"PFXPOSTPONE", |
| 1254 | \"", |
| 1255 | \"MIDWORD '-", |
| 1256 | \"", |
| 1257 | \"SFX q N 1", |
| 1258 | \"SFX q 0 -ok .", |
| 1259 | \"", |
| 1260 | \"SFX a Y 2", |
| 1261 | \"SFX a 0 s .", |
| 1262 | \"SFX a 0 ize/t .", |
| 1263 | \"", |
| 1264 | \"PFX p N 1", |
| 1265 | \"PFX p 0 pre .", |
| 1266 | \"", |
| 1267 | \"PFX P N 1", |
| 1268 | \"PFX P 0 nou .", |
| 1269 | \ ] |
| 1270 | let g:test_data_dic4 = [ |
| 1271 | \"1234", |
| 1272 | \"word/mP", |
| 1273 | \"util/am", |
| 1274 | \"pro/xq", |
| 1275 | \"tomato/m", |
| 1276 | \"bork/mp", |
| 1277 | \"start/s", |
| 1278 | \"end/e", |
| 1279 | \ ] |
| 1280 | let g:test_data_aff5 = [ |
| 1281 | \"SET ISO8859-1", |
| 1282 | \"", |
| 1283 | \"FLAG long", |
| 1284 | \"", |
| 1285 | \"NEEDAFFIX !!", |
| 1286 | \"", |
| 1287 | \"COMPOUNDRULE ssmm*ee", |
| 1288 | \"", |
| 1289 | \"NEEDCOMPOUND xx", |
| 1290 | \"COMPOUNDPERMITFLAG pp", |
| 1291 | \"", |
| 1292 | \"SFX 13 Y 1", |
| 1293 | \"SFX 13 0 bork .", |
| 1294 | \"", |
| 1295 | \"SFX a1 Y 1", |
| 1296 | \"SFX a1 0 a1 .", |
| 1297 | \"", |
| 1298 | \"SFX a\xE9 Y 1", |
| 1299 | \"SFX a\xE9 0 a\xE9 .", |
| 1300 | \"", |
| 1301 | \"PFX zz Y 1", |
| 1302 | \"PFX zz 0 pre/pp .", |
| 1303 | \"", |
| 1304 | \"PFX yy Y 1", |
| 1305 | \"PFX yy 0 nou .", |
| 1306 | \ ] |
| 1307 | let g:test_data_dic5 = [ |
| 1308 | \"1234", |
| 1309 | \"foo/a1a\xE9!!", |
| 1310 | \"bar/zz13ee", |
| 1311 | \"start/ss", |
| 1312 | \"end/eeyy", |
| 1313 | \"middle/mmxx", |
| 1314 | \ ] |
| 1315 | let g:test_data_aff6 = [ |
| 1316 | \"SET ISO8859-1", |
| 1317 | \"", |
| 1318 | \"FLAG caplong", |
| 1319 | \"", |
| 1320 | \"NEEDAFFIX A!", |
| 1321 | \"", |
| 1322 | \"COMPOUNDRULE sMm*Ee", |
| 1323 | \"", |
| 1324 | \"NEEDCOMPOUND Xx", |
| 1325 | \"", |
| 1326 | \"COMPOUNDPERMITFLAG p", |
| 1327 | \"", |
| 1328 | \"SFX N3 Y 1", |
| 1329 | \"SFX N3 0 bork .", |
| 1330 | \"", |
| 1331 | \"SFX A1 Y 1", |
| 1332 | \"SFX A1 0 a1 .", |
| 1333 | \"", |
| 1334 | \"SFX A\xE9 Y 1", |
| 1335 | \"SFX A\xE9 0 a\xE9 .", |
| 1336 | \"", |
| 1337 | \"PFX Zz Y 1", |
| 1338 | \"PFX Zz 0 pre/p .", |
| 1339 | \ ] |
| 1340 | let g:test_data_dic6 = [ |
| 1341 | \"1234", |
| 1342 | \"mee/A1A\xE9A!", |
| 1343 | \"bar/ZzN3Ee", |
| 1344 | \"lead/s", |
| 1345 | \"end/Ee", |
| 1346 | \"middle/MmXx", |
| 1347 | \ ] |
| 1348 | let g:test_data_aff7 = [ |
| 1349 | \"SET ISO8859-1", |
| 1350 | \"", |
| 1351 | \"FLAG num", |
| 1352 | \"", |
| 1353 | \"NEEDAFFIX 9999", |
| 1354 | \"", |
| 1355 | \"COMPOUNDRULE 2,77*123", |
| 1356 | \"", |
| 1357 | \"NEEDCOMPOUND 1", |
| 1358 | \"COMPOUNDPERMITFLAG 432", |
| 1359 | \"", |
| 1360 | \"SFX 61003 Y 1", |
| 1361 | \"SFX 61003 0 meat .", |
| 1362 | \"", |
Bram Moolenaar | 3d2a47c | 2019-11-07 20:48:42 +0100 | [diff] [blame] | 1363 | \"SFX 0 Y 1", |
| 1364 | \"SFX 0 0 zero .", |
| 1365 | \"", |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 1366 | \"SFX 391 Y 1", |
| 1367 | \"SFX 391 0 a1 .", |
| 1368 | \"", |
| 1369 | \"SFX 111 Y 1", |
| 1370 | \"SFX 111 0 a\xE9 .", |
| 1371 | \"", |
| 1372 | \"PFX 17 Y 1", |
| 1373 | \"PFX 17 0 pre/432 .", |
| 1374 | \ ] |
| 1375 | let g:test_data_dic7 = [ |
| 1376 | \"1234", |
Bram Moolenaar | 3d2a47c | 2019-11-07 20:48:42 +0100 | [diff] [blame] | 1377 | \"mee/0,391,111,9999", |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 1378 | \"bar/17,61003,123", |
| 1379 | \"lead/2", |
| 1380 | \"tail/123", |
| 1381 | \"middle/77,1", |
| 1382 | \ ] |
| 1383 | let g:test_data_aff8 = [ |
| 1384 | \"SET ISO8859-1", |
| 1385 | \"", |
| 1386 | \"NOSPLITSUGS", |
| 1387 | \ ] |
| 1388 | let g:test_data_dic8 = [ |
| 1389 | \"1234", |
| 1390 | \"foo", |
| 1391 | \"bar", |
| 1392 | \"faabar", |
| 1393 | \ ] |
| 1394 | let g:test_data_aff9 = [ |
| 1395 | \ ] |
| 1396 | let g:test_data_dic9 = [ |
| 1397 | \"1234", |
| 1398 | \"foo", |
| 1399 | \"bar", |
| 1400 | \ ] |
Bram Moolenaar | 37ff4cf | 2019-11-17 20:10:20 +0100 | [diff] [blame] | 1401 | let g:test_data_aff10 = [ |
| 1402 | \"COMPOUNDRULE se", |
| 1403 | \"COMPOUNDPERMITFLAG p", |
| 1404 | \"", |
| 1405 | \"SFX A Y 1", |
| 1406 | \"SFX A 0 able/Mp .", |
| 1407 | \"", |
| 1408 | \"SFX M Y 1", |
| 1409 | \"SFX M 0 s .", |
| 1410 | \ ] |
| 1411 | let g:test_data_dic10 = [ |
| 1412 | \"1234", |
| 1413 | \"drink/As", |
| 1414 | \"table/e", |
| 1415 | \ ] |
Bram Moolenaar | d2c061d | 2017-06-22 21:42:49 +0200 | [diff] [blame] | 1416 | let g:test_data_aff_sal = [ |
| 1417 | \"SET ISO8859-1", |
| 1418 | \"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ", |
| 1419 | \"", |
| 1420 | \"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", |
| 1421 | \"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", |
| 1422 | \"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", |
| 1423 | \"", |
| 1424 | \"MIDWORD\t'-", |
| 1425 | \"", |
| 1426 | \"KEP =", |
| 1427 | \"RAR ?", |
| 1428 | \"BAD !", |
| 1429 | \"", |
| 1430 | \"PFX I N 1", |
| 1431 | \"PFX I 0 in .", |
| 1432 | \"", |
| 1433 | \"PFX O Y 1", |
| 1434 | \"PFX O 0 out .", |
| 1435 | \"", |
| 1436 | \"SFX S Y 2", |
| 1437 | \"SFX S 0 s [^s]", |
| 1438 | \"SFX S 0 es s", |
| 1439 | \"", |
| 1440 | \"SFX N N 3", |
| 1441 | \"SFX N 0 en [^n]", |
| 1442 | \"SFX N 0 nen n", |
| 1443 | \"SFX N 0 n .", |
| 1444 | \"", |
| 1445 | \"REP 3", |
| 1446 | \"REP g ch", |
| 1447 | \"REP ch g", |
| 1448 | \"REP svp s.v.p.", |
| 1449 | \"", |
| 1450 | \"MAP 9", |
| 1451 | \"MAP a\xE0\xE1\xE2\xE3\xE4\xE5", |
| 1452 | \"MAP e\xE8\xE9\xEA\xEB", |
| 1453 | \"MAP i\xEC\xED\xEE\xEF", |
| 1454 | \"MAP o\xF2\xF3\xF4\xF5\xF6", |
| 1455 | \"MAP u\xF9\xFA\xFB\xFC", |
| 1456 | \"MAP n\xF1", |
| 1457 | \"MAP c\xE7", |
| 1458 | \"MAP y\xFF\xFD", |
| 1459 | \"MAP s\xDF", |
| 1460 | \"", |
| 1461 | \"SAL AH(AEIOUY)-^ *H", |
| 1462 | \"SAL AR(AEIOUY)-^ *R", |
| 1463 | \"SAL A(HR)^ *", |
| 1464 | \"SAL A^ *", |
| 1465 | \"SAL AH(AEIOUY)- H", |
| 1466 | \"SAL AR(AEIOUY)- R", |
| 1467 | \"SAL A(HR) _", |
| 1468 | \"SAL \xC0^ *", |
| 1469 | \"SAL \xC5^ *", |
| 1470 | \"SAL BB- _", |
| 1471 | \"SAL B B", |
| 1472 | \"SAL CQ- _", |
| 1473 | \"SAL CIA X", |
| 1474 | \"SAL CH X", |
| 1475 | \"SAL C(EIY)- S", |
| 1476 | \"SAL CK K", |
| 1477 | \"SAL COUGH^ KF", |
| 1478 | \"SAL CC< C", |
| 1479 | \"SAL C K", |
| 1480 | \"SAL DG(EIY) K", |
| 1481 | \"SAL DD- _", |
| 1482 | \"SAL D T", |
| 1483 | \"SAL \xC9< E", |
| 1484 | \"SAL EH(AEIOUY)-^ *H", |
| 1485 | \"SAL ER(AEIOUY)-^ *R", |
| 1486 | \"SAL E(HR)^ *", |
| 1487 | \"SAL ENOUGH^$ *NF", |
| 1488 | \"SAL E^ *", |
| 1489 | \"SAL EH(AEIOUY)- H", |
| 1490 | \"SAL ER(AEIOUY)- R", |
| 1491 | \"SAL E(HR) _", |
| 1492 | \"SAL FF- _", |
| 1493 | \"SAL F F", |
| 1494 | \"SAL GN^ N", |
| 1495 | \"SAL GN$ N", |
| 1496 | \"SAL GNS$ NS", |
| 1497 | \"SAL GNED$ N", |
| 1498 | \"SAL GH(AEIOUY)- K", |
| 1499 | \"SAL GH _", |
| 1500 | \"SAL GG9 K", |
| 1501 | \"SAL G K", |
| 1502 | \"SAL H H", |
| 1503 | \"SAL IH(AEIOUY)-^ *H", |
| 1504 | \"SAL IR(AEIOUY)-^ *R", |
| 1505 | \"SAL I(HR)^ *", |
| 1506 | \"SAL I^ *", |
| 1507 | \"SAL ING6 N", |
| 1508 | \"SAL IH(AEIOUY)- H", |
| 1509 | \"SAL IR(AEIOUY)- R", |
| 1510 | \"SAL I(HR) _", |
| 1511 | \"SAL J K", |
| 1512 | \"SAL KN^ N", |
| 1513 | \"SAL KK- _", |
| 1514 | \"SAL K K", |
| 1515 | \"SAL LAUGH^ LF", |
| 1516 | \"SAL LL- _", |
| 1517 | \"SAL L L", |
| 1518 | \"SAL MB$ M", |
| 1519 | \"SAL MM M", |
| 1520 | \"SAL M M", |
| 1521 | \"SAL NN- _", |
| 1522 | \"SAL N N", |
| 1523 | \"SAL OH(AEIOUY)-^ *H", |
| 1524 | \"SAL OR(AEIOUY)-^ *R", |
| 1525 | \"SAL O(HR)^ *", |
| 1526 | \"SAL O^ *", |
| 1527 | \"SAL OH(AEIOUY)- H", |
| 1528 | \"SAL OR(AEIOUY)- R", |
| 1529 | \"SAL O(HR) _", |
| 1530 | \"SAL PH F", |
| 1531 | \"SAL PN^ N", |
| 1532 | \"SAL PP- _", |
| 1533 | \"SAL P P", |
| 1534 | \"SAL Q K", |
| 1535 | \"SAL RH^ R", |
| 1536 | \"SAL ROUGH^ RF", |
| 1537 | \"SAL RR- _", |
| 1538 | \"SAL R R", |
| 1539 | \"SAL SCH(EOU)- SK", |
| 1540 | \"SAL SC(IEY)- S", |
| 1541 | \"SAL SH X", |
| 1542 | \"SAL SI(AO)- X", |
| 1543 | \"SAL SS- _", |
| 1544 | \"SAL S S", |
| 1545 | \"SAL TI(AO)- X", |
| 1546 | \"SAL TH @", |
| 1547 | \"SAL TCH-- _", |
| 1548 | \"SAL TOUGH^ TF", |
| 1549 | \"SAL TT- _", |
| 1550 | \"SAL T T", |
| 1551 | \"SAL UH(AEIOUY)-^ *H", |
| 1552 | \"SAL UR(AEIOUY)-^ *R", |
| 1553 | \"SAL U(HR)^ *", |
| 1554 | \"SAL U^ *", |
| 1555 | \"SAL UH(AEIOUY)- H", |
| 1556 | \"SAL UR(AEIOUY)- R", |
| 1557 | \"SAL U(HR) _", |
| 1558 | \"SAL V^ W", |
| 1559 | \"SAL V F", |
| 1560 | \"SAL WR^ R", |
| 1561 | \"SAL WH^ W", |
| 1562 | \"SAL W(AEIOU)- W", |
| 1563 | \"SAL X^ S", |
| 1564 | \"SAL X KS", |
| 1565 | \"SAL Y(AEIOU)- Y", |
| 1566 | \"SAL ZZ- _", |
| 1567 | \"SAL Z S", |
| 1568 | \ ] |
Bram Moolenaar | 0e05de4 | 2020-03-25 22:23:46 +0100 | [diff] [blame] | 1569 | |
| 1570 | " vim: shiftwidth=2 sts=2 expandtab |