annotate src/testdir/test_spellfile.vim @ 22298:07e48ee8c3bb v8.2.1698

patch 8.2.1698: cannot lock a variable in legacy Vim script like in Vim9 Commit: https://github.com/vim/vim/commit/a187c43cfe8863d48b2159d695fedcb71f8525c1 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 16 21:08:28 2020 +0200 patch 8.2.1698: cannot lock a variable in legacy Vim script like in Vim9 Problem: Cannot lock a variable in legacy Vim script like in Vim9. Solution: Make ":lockvar 0" work.
author Bram Moolenaar <Bram@vim.org>
date Wed, 16 Sep 2020 21:15:05 +0200
parents 37ad27fa22e7
children b3751f4d3b26
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17682
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Test for commands that operate on the spellfile.
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 source shared.vim
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 source check.vim
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 CheckFeature spell
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 CheckFeature syntax
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 func Test_spell_normal()
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 new
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 call append(0, ['1 good', '2 goood', '3 goood'])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 set spell spellfile=./Xspellfile.add spelllang=en
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 let oldlang=v:lang
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 lang C
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 " Test for zg
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 1
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 norm! ]s
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 call assert_equal('2 goood', getline('.'))
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 norm! zg
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 1
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 let a=execute('unsilent :norm! ]s')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 call assert_equal('1 good', getline('.'))
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 call assert_equal('search hit BOTTOM, continuing at TOP', a[1:])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 let cnt=readfile('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 call assert_equal('goood', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 " Test for zw
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 2
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 norm! $zw
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 1
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 norm! ]s
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 call assert_equal('2 goood', getline('.'))
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 let cnt=readfile('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 call assert_equal('#oood', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 call assert_equal('goood/!', cnt[1])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 " Test for :spellrare
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 spellrare rare
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 let cnt=readfile('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 call assert_equal(['#oood', 'goood/!', 'rare/?'], cnt)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 " Make sure :spellundo works for rare words.
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 spellundo rare
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 let cnt=readfile('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 call assert_equal(['#oood', 'goood/!', '#are/?'], cnt)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 " Test for zg in visual mode
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 let a=execute('unsilent :norm! V$zg')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 call assert_equal("Word '2 goood' added to ./Xspellfile.add", a[1:])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 1
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 norm! ]s
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 call assert_equal('3 goood', getline('.'))
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 let cnt=readfile('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 call assert_equal('2 goood', cnt[3])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 " Remove "2 good" from spellfile
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 2
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 let a=execute('unsilent norm! V$zw')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 call assert_equal("Word '2 goood' added to ./Xspellfile.add", a[1:])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 let cnt=readfile('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 call assert_equal('2 goood/!', cnt[4])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 " Test for zG
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 let a=execute('unsilent norm! V$zG')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 call assert_match("Word '2 goood' added to .*", a)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 let fname=matchstr(a, 'to\s\+\zs\f\+$')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 let cnt=readfile(fname)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 call assert_equal('2 goood', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 " Test for zW
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 let a=execute('unsilent norm! V$zW')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 call assert_match("Word '2 goood' added to .*", a)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 let cnt=readfile(fname)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 call assert_equal('# goood', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 call assert_equal('2 goood/!', cnt[1])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 " Test for zuW
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 let a=execute('unsilent norm! V$zuW')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 call assert_match("Word '2 goood' removed from .*", a)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 let cnt=readfile(fname)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 call assert_equal('# goood', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 call assert_equal('# goood/!', cnt[1])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 " Test for zuG
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 let a=execute('unsilent norm! $zG')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 call assert_match("Word 'goood' added to .*", a)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 let cnt=readfile(fname)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 call assert_equal('# goood', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 call assert_equal('# goood/!', cnt[1])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 call assert_equal('goood', cnt[2])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 let a=execute('unsilent norm! $zuG')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 let cnt=readfile(fname)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 call assert_match("Word 'goood' removed from .*", a)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 call assert_equal('# goood', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 call assert_equal('# goood/!', cnt[1])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 call assert_equal('#oood', cnt[2])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 " word not found in wordlist
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 let a=execute('unsilent norm! V$zuG')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 let cnt=readfile(fname)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100 call assert_match("", a)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 call assert_equal('# goood', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 call assert_equal('# goood/!', cnt[1])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103 call assert_equal('#oood', cnt[2])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 " Test for zug
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 call delete('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 2
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 let a=execute('unsilent norm! $zg')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109 let cnt=readfile('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 call assert_equal('goood', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111 let a=execute('unsilent norm! $zug')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112 call assert_match("Word 'goood' removed from \./Xspellfile.add", a)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
113 let cnt=readfile('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
114 call assert_equal('#oood', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115 " word not in wordlist
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 let a=execute('unsilent norm! V$zug')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
117 call assert_match('', a)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
118 let cnt=readfile('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119 call assert_equal('#oood', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
121 " Test for zuw
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
122 call delete('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
123 2
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
124 let a=execute('unsilent norm! Vzw')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
125 let cnt=readfile('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
126 call assert_equal('2 goood/!', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
127 let a=execute('unsilent norm! Vzuw')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
128 call assert_match("Word '2 goood' removed from \./Xspellfile.add", a)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
129 let cnt=readfile('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
130 call assert_equal('# goood/!', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
131 " word not in wordlist
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
132 let a=execute('unsilent norm! $zug')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
133 call assert_match('', a)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
134 let cnt=readfile('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
135 call assert_equal('# goood/!', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
136
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
137 " add second entry to spellfile setting
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
138 set spellfile=./Xspellfile.add,./Xspellfile2.add
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
139 call delete('./Xspellfile.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
140 2
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
141 let a=execute('unsilent norm! $2zg')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
142 let cnt=readfile('./Xspellfile2.add')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
143 call assert_match("Word 'goood' added to ./Xspellfile2.add", a)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
144 call assert_equal('goood', cnt[0])
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
145
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
146 " Test for :spellgood!
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
147 let temp = execute(':spe!0/0')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
148 call assert_match('Invalid region', temp)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
149 let spellfile = matchstr(temp, 'Invalid region nr in \zs.*\ze line \d: 0')
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
150 call assert_equal(['# goood', '# goood/!', '#oood', '0/0'], readfile(spellfile))
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
151
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
152 " Test for :spellrare!
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
153 :spellrare! raare
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
154 call assert_equal(['# goood', '# goood/!', '#oood', '0/0', 'raare/?'], readfile(spellfile))
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
155 call delete(spellfile)
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
156
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
157 " clean up
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
158 exe "lang" oldlang
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
159 call delete("./Xspellfile.add")
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
160 call delete("./Xspellfile2.add")
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
161 call delete("./Xspellfile.add.spl")
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
162 call delete("./Xspellfile2.add.spl")
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
163
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
164 " zux -> no-op
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
165 2
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
166 norm! $zux
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
167 call assert_equal([], glob('Xspellfile.add',0,1))
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
168 call assert_equal([], glob('Xspellfile2.add',0,1))
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
169
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
170 set spellfile= spell& spelllang&
17682
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
171 bw!
3dbff5d37520 patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
172 endfunc
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 17682
diff changeset
173
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
174 " Spell file content test. Write 'content' to the spell file prefixed by the
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
175 " spell file header and then enable spell checking. If 'emsg' is not empty,
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
176 " then check for error.
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
177 func Spellfile_Test(content, emsg)
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
178 let splfile = './Xtest/spell/Xtest.utf-8.spl'
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
179 " Add the spell file header and version (VIMspell2)
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
180 let v = 0z56494D7370656C6C32 + a:content
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
181 call writefile(v, splfile, 'b')
22204
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
182
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
183 " 'encoding' is set before each test to clear the previously loaded suggest
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
184 " file from memory.
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
185 set encoding=utf-8
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
186
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
187 set runtimepath=./Xtest
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
188 set spelllang=Xtest
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
189 if a:emsg != ''
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
190 call assert_fails('set spell', a:emsg)
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
191 else
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
192 " FIXME: With some invalid spellfile contents, there are no error
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
193 " messages. So don't know how to check for the test result.
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
194 set spell
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
195 endif
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
196 set nospell spelllang& rtp&
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
197 endfunc
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
198
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
199 " Test for spell file format errors.
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
200 " The spell file format is described in spellfile.c
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
201 func Test_spellfile_format_error()
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
202 let save_rtp = &rtp
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
203 call mkdir('Xtest/spell', 'p')
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
204 let splfile = './Xtest/spell/Xtest.utf-8.spl'
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
205
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
206 " empty spell file
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
207 call writefile([], splfile)
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
208 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
209 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
210 call assert_fails('set spell', 'E757:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
211 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
212
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
213 " invalid file ID
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
214 call writefile(0z56494D, splfile, 'b')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
215 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
216 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
217 call assert_fails('set spell', 'E757:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
218 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
219
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
220 " missing version number
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
221 call writefile(0z56494D7370656C6C, splfile, 'b')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
222 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
223 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
224 call assert_fails('set spell', 'E771:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
225 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
226
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
227 " invalid version number
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
228 call writefile(0z56494D7370656C6C7A, splfile, 'b')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
229 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
230 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
231 call assert_fails('set spell', 'E772:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
232 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
233
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
234 " no sections
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
235 call Spellfile_Test(0z, 'E758:')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
236
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
237 " missing section length
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
238 call Spellfile_Test(0z00, 'E758:')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
239
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
240 " unsupported required section
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
241 call Spellfile_Test(0z7A0100000004, 'E770:')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
242
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
243 " unsupported not-required section
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
244 call Spellfile_Test(0z7A0000000004, 'E758:')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
245
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
246 " SN_REGION: invalid number of region names
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
247 call Spellfile_Test(0z0000000000FF, 'E759:')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
248
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
249 " SN_CHARFLAGS: missing <charflagslen> length
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
250 call Spellfile_Test(0z010000000004, 'E758:')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
251
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
252 " SN_CHARFLAGS: invalid <charflagslen> length
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
253 call Spellfile_Test(0z0100000000010201, '')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
254
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
255 " SN_CHARFLAGS: charflagslen == 0 and folcharslen != 0
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
256 call Spellfile_Test(0z01000000000400000101, 'E759:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
257
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
258 " SN_CHARFLAGS: missing <folcharslen> length
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
259 call Spellfile_Test(0z01000000000100, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
260
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
261 " SN_PREFCOND: invalid prefcondcnt
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
262 call Spellfile_Test(0z03000000000100, 'E759:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
263
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
264 " SN_PREFCOND: invalid condlen
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
265 call Spellfile_Test(0z0300000000020001, 'E759:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
266
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
267 " SN_REP: invalid repcount
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
268 call Spellfile_Test(0z04000000000100, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
269
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
270 " SN_REP: missing rep
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
271 call Spellfile_Test(0z0400000000020004, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
272
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
273 " SN_REP: zero repfromlen
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
274 call Spellfile_Test(0z040000000003000100, 'E759:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
275
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
276 " SN_REP: invalid reptolen
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
277 call Spellfile_Test(0z0400000000050001014101, '')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
278
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
279 " SN_REP: zero reptolen
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
280 call Spellfile_Test(0z0400000000050001014100, 'E759:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
281
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
282 " SN_SAL: missing salcount
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
283 call Spellfile_Test(0z05000000000102, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
284
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
285 " SN_SAL: missing salfromlen
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
286 call Spellfile_Test(0z050000000003080001, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
287
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
288 " SN_SAL: missing saltolen
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
289 call Spellfile_Test(0z0500000000050400010161, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
290
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
291 " SN_WORDS: non-NUL terminated word
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
292 call Spellfile_Test(0z0D000000000376696D, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
293
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
294 " SN_WORDS: very long word
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
295 let v = eval('0z0D000000012C' .. repeat('41', 300))
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
296 call Spellfile_Test(v, 'E759:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
297
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
298 " SN_SOFO: missing sofofromlen
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
299 call Spellfile_Test(0z06000000000100, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
300
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
301 " SN_SOFO: missing sofotolen
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
302 call Spellfile_Test(0z06000000000400016100, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
303
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
304 " SN_SOFO: missing sofoto
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
305 call Spellfile_Test(0z0600000000050001610000, 'E759:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
306
22204
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
307 " SN_SOFO: empty sofofrom and sofoto
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
308 call Spellfile_Test(0z06000000000400000000FF000000000000000000000000, '')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
309
22220
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
310 " SN_SOFO: multi-byte characters in sofofrom and sofoto
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
311 call Spellfile_Test(0z0600000000080002CF810002CF82FF000000000000000000000000, '')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
312
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
313 " SN_COMPOUND: compmax is less than 2
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
314 call Spellfile_Test(0z08000000000101, 'E759:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
315
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
316 " SN_COMPOUND: missing compsylmax and other options
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
317 call Spellfile_Test(0z0800000000020401, 'E759:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
318
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
319 " SN_COMPOUND: missing compoptions
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
320 call Spellfile_Test(0z080000000005040101, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
321
22204
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
322 " SN_COMPOUND: missing comppattern
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
323 call Spellfile_Test(0z08000000000704010100000001, 'E758:')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
324
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
325 " SN_COMPOUND: incorrect comppatlen
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
326 call Spellfile_Test(0z080000000007040101000000020165, 'E758:')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
327
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
328 " SN_INFO: missing info
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
329 call Spellfile_Test(0z0F0000000005040101, '')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
330
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
331 " SN_MIDWORD: missing midword
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
332 call Spellfile_Test(0z0200000000040102, '')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
333
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
334 " SN_MAP: missing midword
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
335 call Spellfile_Test(0z0700000000040102, '')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
336
22204
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
337 " SN_MAP: empty map string
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
338 call Spellfile_Test(0z070000000000FF000000000000000000000000, '')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
339
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
340 " SN_MAP: duplicate multibyte character
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
341 call Spellfile_Test(0z070000000004DC81DC81, 'E783:')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
342
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
343 " SN_SYLLABLE: missing SYLLABLE item
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
344 call Spellfile_Test(0z0900000000040102, '')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
345
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
346 " SN_SYLLABLE: More than SY_MAXLEN size
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
347 let v = eval('0z090000000022612F' .. repeat('62', 32))
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
348 call Spellfile_Test(v, '')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
349
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
350 " LWORDTREE: missing
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
351 call Spellfile_Test(0zFF, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
352
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
353 " LWORDTREE: missing tree node
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
354 call Spellfile_Test(0zFF00000004, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
355
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
356 " LWORDTREE: missing tree node value
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
357 call Spellfile_Test(0zFF0000000402, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
358
22204
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
359 " LWORDTREE: incorrect sibling node count
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
360 call Spellfile_Test(0zFF00000001040000000000000000, 'E759:')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
361
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
362 " KWORDTREE: missing tree node
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
363 call Spellfile_Test(0zFF0000000000000004, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
364
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
365 " PREFIXTREE: missing tree node
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
366 call Spellfile_Test(0zFF000000000000000000000004, 'E758:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
367
22204
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
368 " PREFIXTREE: incorrect prefcondnr
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
369 call Spellfile_Test(0zFF000000000000000000000002010200000020, 'E759:')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
370
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
371 " PREFIXTREE: invalid nodeidx
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
372 call Spellfile_Test(0zFF00000000000000000000000201010000, 'E759:')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
373
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
374 let &rtp = save_rtp
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
375 call delete('Xtest', 'rf')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
376 endfunc
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
377
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
378 " Test for format errors in suggest file
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
379 func Test_sugfile_format_error()
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
380 let save_rtp = &rtp
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
381 call mkdir('Xtest/spell', 'p')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
382 let splfile = './Xtest/spell/Xtest.utf-8.spl'
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
383 let sugfile = './Xtest/spell/Xtest.utf-8.sug'
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
384
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
385 " create an empty spell file with a suggest timestamp
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
386 call writefile(0z56494D7370656C6C320B00000000080000000000000044FF000000000000000000000000, splfile, 'b')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
387
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
388 " 'encoding' is set before each test to clear the previously loaded suggest
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
389 " file from memory.
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
390
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
391 " empty suggest file
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
392 set encoding=utf-8
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
393 call writefile([], sugfile)
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
394 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
395 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
396 set spell
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
397 call assert_fails("let s = spellsuggest('abc')", 'E778:')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
398 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
399
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
400 " zero suggest version
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
401 set encoding=utf-8
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
402 call writefile(0z56494D73756700, sugfile)
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
403 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
404 set spelllang=Xtest
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
405 set spell
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
406 call assert_fails("let s = spellsuggest('abc')", 'E779:')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
407 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
408
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
409 " unsupported suggest version
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
410 set encoding=utf-8
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
411 call writefile(0z56494D7375671F, sugfile)
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
412 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
413 set spelllang=Xtest
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
414 set spell
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
415 call assert_fails("let s = spellsuggest('abc')", 'E780:')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
416 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
417
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
418 " missing suggest timestamp
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
419 set encoding=utf-8
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
420 call writefile(0z56494D73756701, sugfile)
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
421 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
422 set spelllang=Xtest
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
423 set spell
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
424 call assert_fails("let s = spellsuggest('abc')", 'E781:')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
425 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
426
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
427 " incorrect suggest timestamp
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
428 set encoding=utf-8
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
429 call writefile(0z56494D7375670100000000000000FF, sugfile)
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
430 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
431 set spelllang=Xtest
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
432 set spell
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
433 call assert_fails("let s = spellsuggest('abc')", 'E781:')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
434 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
435
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
436 " missing suggest wordtree
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
437 set encoding=utf-8
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
438 call writefile(0z56494D737567010000000000000044, sugfile)
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
439 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
440 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
441 set spell
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
442 call assert_fails("let s = spellsuggest('abc')", 'E782:')
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
443 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
444
21947
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
445 " invalid suggest word count in SUGTABLE
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
446 set encoding=utf-8
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
447 call writefile(0z56494D7375670100000000000000440000000022, sugfile)
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
448 set runtimepath=./Xtest
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
449 set spelllang=Xtest
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
450 set spell
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
451 call assert_fails("let s = spellsuggest('abc')", 'E782:')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
452 set nospell spelllang&
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
453
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
454 " missing sugline in SUGTABLE
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
455 set encoding=utf-8
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
456 call writefile(0z56494D7375670100000000000000440000000000000005, sugfile)
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
457 set runtimepath=./Xtest
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
458 set spelllang=Xtest
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
459 set spell
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
460 call assert_fails("let s = spellsuggest('abc')", 'E782:')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
461 set nospell spelllang&
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
462
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
463 let &rtp = save_rtp
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
464 call delete('Xtest', 'rf')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
465 endfunc
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
466
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
467 " Test for using :mkspell to create a spell file from a list of words
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
468 func Test_wordlist_dic()
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
469 " duplicate encoding
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
470 let lines =<< trim [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
471 # This is an example word list
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
472
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
473 /encoding=latin1
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
474 /encoding=latin1
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
475 example
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
476 [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
477 call writefile(lines, 'Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
478 let output = execute('mkspell Xwordlist.spl Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
479 call assert_match('Duplicate /encoding= line ignored in Xwordlist.dic line 4: /encoding=latin1', output)
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
480
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
481 " multiple encoding for a word
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
482 let lines =<< trim [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
483 example
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
484 /encoding=latin1
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
485 example
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
486 [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
487 call writefile(lines, 'Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
488 let output = execute('mkspell! Xwordlist.spl Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
489 call assert_match('/encoding= line after word ignored in Xwordlist.dic line 2: /encoding=latin1', output)
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
490
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
491 " unsupported encoding for a word
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
492 let lines =<< trim [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
493 /encoding=Xtest
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
494 example
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
495 [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
496 call writefile(lines, 'Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
497 let output = execute('mkspell! Xwordlist.spl Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
498 call assert_match('Conversion in Xwordlist.dic not supported: from Xtest to utf-8', output)
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
499
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
500 " duplicate region
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
501 let lines =<< trim [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
502 /regions=usca
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
503 /regions=usca
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
504 example
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
505 [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
506 call writefile(lines, 'Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
507 let output = execute('mkspell! Xwordlist.spl Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
508 call assert_match('Duplicate /regions= line ignored in Xwordlist.dic line 2: regions=usca', output)
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
509
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
510 " maximum regions
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
511 let lines =<< trim [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
512 /regions=uscauscauscauscausca
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
513 example
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
514 [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
515 call writefile(lines, 'Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
516 let output = execute('mkspell! Xwordlist.spl Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
517 call assert_match('Too many regions in Xwordlist.dic line 1: uscauscauscauscausca', output)
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
518
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
519 " unsupported '/' value
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
520 let lines =<< trim [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
521 /test=abc
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
522 example
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
523 [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
524 call writefile(lines, 'Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
525 let output = execute('mkspell! Xwordlist.spl Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
526 call assert_match('/ line ignored in Xwordlist.dic line 1: /test=abc', output)
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
527
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
528 " unsupported flag
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
529 let lines =<< trim [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
530 example/+
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
531 [END]
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
532 call writefile(lines, 'Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
533 let output = execute('mkspell! Xwordlist.spl Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
534 call assert_match('Unrecognized flags in Xwordlist.dic line 1: +', output)
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
535
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
536 " non-ascii word
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
537 call writefile(["ʀʀ"], 'Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
538 let output = execute('mkspell! -ascii Xwordlist.spl Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
539 call assert_match('Ignored 1 words with non-ASCII characters', output)
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
540
22204
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
541 " keep case of a word
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
542 let lines =<< trim [END]
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
543 example/=
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
544 [END]
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
545 call writefile(lines, 'Xwordlist.dic')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
546 let output = execute('mkspell! Xwordlist.spl Xwordlist.dic')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
547 call assert_match('Compressed keep-case:', output)
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
548
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
549 call delete('Xwordlist.spl')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
550 call delete('Xwordlist.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
551 endfunc
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
552
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
553 " Test for the :mkspell command
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
554 func Test_mkspell()
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
555 call assert_fails('mkspell Xtest_us.spl', 'E751:')
22220
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
556 call assert_fails('mkspell Xtest.spl abc', 'E484:')
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
557 call assert_fails('mkspell a b c d e f g h i j k', 'E754:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
558
22220
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
559 " create a .aff file but not the .dic file
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
560 call writefile([], 'Xtest.aff')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
561 call assert_fails('mkspell Xtest.spl Xtest', 'E484:')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
562 call delete('Xtest.aff')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
563
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
564 call writefile([], 'Xtest.spl')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
565 call writefile([], 'Xtest.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
566 call assert_fails('mkspell Xtest.spl Xtest.dic', 'E13:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
567 call delete('Xtest.spl')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
568 call delete('Xtest.dic')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
569
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
570 call mkdir('Xtest.spl')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
571 call assert_fails('mkspell! Xtest.spl Xtest.dic', 'E17:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
572 call delete('Xtest.spl', 'rf')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
573
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
574 call assert_fails('mkspell en en_US abc_xyz', 'E755:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
575 endfunc
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
576
21945
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
577 " Tests for :mkspell with a .dic and .aff file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
578 func Test_aff_file_format_error()
21947
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
579 " FIXME: For some reason, the :mkspell command below doesn't fail on the
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
580 " MS-Windows CI build. Disable this test on MS-Windows for now.
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
581 CheckNotMSWindows
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
582
21945
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
583 " No word count in .dic file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
584 call writefile([], 'Xtest.dic')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
585 call writefile([], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
586 call assert_fails('mkspell! Xtest.spl Xtest', 'E760:')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
587
21947
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
588 " create a .dic file for the tests below
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
589 call writefile(['1', 'work'], 'Xtest.dic')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
590
21945
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
591 " Invalid encoding in .aff file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
592 call writefile(['# comment', 'SET Xinvalidencoding'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
593 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
594 call assert_match('Conversion in Xtest.aff not supported: from xinvalidencoding', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
595
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
596 " Invalid flag in .aff file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
597 call writefile(['FLAG xxx'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
598 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
599 call assert_match('Invalid value for FLAG in Xtest.aff line 1: xxx', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
600
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
601 " set FLAGS after using flag for an affix
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
602 call writefile(['SFX L Y 1', 'SFX L 0 re [^x]', 'FLAG long'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
603 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
604 call assert_match('FLAG after using flags in Xtest.aff line 3: long', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
605
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
606 " INFO in affix file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
607 let save_encoding = &encoding
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
608 call mkdir('Xrtp/spell', 'p')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
609 call writefile(['1', 'work'], 'Xrtp/spell/Xtest.dic')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
610 call writefile(['NAME klingon', 'VERSION 1.4', 'AUTHOR Spock'],
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
611 \ 'Xrtp/spell/Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
612 silent mkspell! Xrtp/spell/Xtest.utf-8.spl Xrtp/spell/Xtest
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
613 let save_rtp = &rtp
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
614 set runtimepath=./Xrtp
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
615 set spelllang=Xtest
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
616 set spell
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
617 let output = split(execute('spellinfo'), "\n")
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
618 call assert_equal("NAME klingon", output[1])
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
619 call assert_equal("VERSION 1.4", output[2])
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
620 call assert_equal("AUTHOR Spock", output[3])
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
621 let &rtp = save_rtp
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
622 call delete('Xrtp', 'rf')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
623 set spell& spelllang& spellfile&
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
624 %bw!
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
625 " 'encoding' must be set again to clear the spell file in memory
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
626 let &encoding = save_encoding
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
627
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
628 " COMPOUNDFORBIDFLAG flag after PFX in an affix file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
629 call writefile(['PFX L Y 1', 'PFX L 0 re x', 'COMPOUNDFLAG c', 'COMPOUNDFORBIDFLAG x'],
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
630 \ 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
631 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
632 call assert_match('Defining COMPOUNDFORBIDFLAG after PFX item may give wrong results in Xtest.aff line 4', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
633
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
634 " COMPOUNDPERMITFLAG flag after PFX in an affix file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
635 call writefile(['PFX L Y 1', 'PFX L 0 re x', 'COMPOUNDPERMITFLAG c'],
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
636 \ 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
637 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
638 call assert_match('Defining COMPOUNDPERMITFLAG after PFX item may give wrong results in Xtest.aff line 3', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
639
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
640 " Wrong COMPOUNDRULES flag value in an affix file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
641 call writefile(['COMPOUNDRULES a'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
642 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
643 call assert_match('Wrong COMPOUNDRULES value in Xtest.aff line 1: a', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
644
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
645 " Wrong COMPOUNDWORDMAX flag value in an affix file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
646 call writefile(['COMPOUNDWORDMAX 0'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
647 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
648 call assert_match('Wrong COMPOUNDWORDMAX value in Xtest.aff line 1: 0', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
649
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
650 " Wrong COMPOUNDMIN flag value in an affix file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
651 call writefile(['COMPOUNDMIN 0'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
652 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
653 call assert_match('Wrong COMPOUNDMIN value in Xtest.aff line 1: 0', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
654
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
655 " Wrong COMPOUNDSYLMAX flag value in an affix file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
656 call writefile(['COMPOUNDSYLMAX 0'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
657 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
658 call assert_match('Wrong COMPOUNDSYLMAX value in Xtest.aff line 1: 0', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
659
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
660 " Wrong CHECKCOMPOUNDPATTERN flag value in an affix file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
661 call writefile(['CHECKCOMPOUNDPATTERN 0'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
662 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
663 call assert_match('Wrong CHECKCOMPOUNDPATTERN value in Xtest.aff line 1: 0', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
664
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
665 " Duplicate affix entry in an affix file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
666 call writefile(['PFX L Y 1', 'PFX L 0 re x', 'PFX L Y 1', 'PFX L 0 re x'],
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
667 \ 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
668 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
669 call assert_match('Duplicate affix in Xtest.aff line 3: L', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
670
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
671 " Duplicate affix entry in an affix file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
672 call writefile(['PFX L Y 1', 'PFX L Y 1'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
673 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
674 call assert_match('Unrecognized or duplicate item in Xtest.aff line 2: PFX', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
675
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
676 " Different combining flags in an affix file
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
677 call writefile(['PFX L Y 1', 'PFX L 0 re x', 'PFX L N 1'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
678 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
679 call assert_match('Different combining flag in continued affix block in Xtest.aff line 3', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
680
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
681 " Try to reuse a affix used for BAD flag
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
682 call writefile(['BAD x', 'PFX x Y 1', 'PFX x 0 re x'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
683 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
684 call assert_match('Affix also used for BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGEST in Xtest.aff line 2: x', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
685
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
686 " Trailing characters in an affix entry
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
687 call writefile(['PFX L Y 1 Test', 'PFX L 0 re x'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
688 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
689 call assert_match('Trailing text in Xtest.aff line 1: Test', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
690
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
691 " Trailing characters in an affix entry
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
692 call writefile(['PFX L Y 1', 'PFX L 0 re x Test'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
693 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
694 call assert_match('Trailing text in Xtest.aff line 2: Test', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
695
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
696 " Incorrect combine flag in an affix entry
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
697 call writefile(['PFX L X 1', 'PFX L 0 re x'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
698 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
699 call assert_match('Expected Y or N in Xtest.aff line 1: X', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
700
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
701 " Invalid count for REP item
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
702 call writefile(['REP a'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
703 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
704 call assert_match('Expected REP(SAL) count in Xtest.aff line 1', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
705
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
706 " Trailing characters in REP item
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
707 call writefile(['REP 1', 'REP f ph test'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
708 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
709 call assert_match('Trailing text in Xtest.aff line 2: test', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
710
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
711 " Invalid count for MAP item
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
712 call writefile(['MAP a'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
713 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
714 call assert_match('Expected MAP count in Xtest.aff line 1', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
715
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
716 " Duplicate character in a MAP item
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
717 call writefile(['MAP 2', 'MAP xx', 'MAP yy'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
718 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
719 call assert_match('Duplicate character in MAP in Xtest.aff line 2', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
720
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
721 " Use COMPOUNDSYLMAX without SYLLABLE
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
722 call writefile(['COMPOUNDSYLMAX 2'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
723 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
724 call assert_match('COMPOUNDSYLMAX used without SYLLABLE', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
725
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
726 " Missing SOFOTO
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
727 call writefile(['SOFOFROM abcdef'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
728 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
729 call assert_match('Missing SOFOTO line in Xtest.aff', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
730
21947
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
731 " Length of SOFOFROM and SOFOTO differ
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
732 call writefile(['SOFOFROM abcde', 'SOFOTO ABCD'], 'Xtest.aff')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
733 call assert_fails('mkspell! Xtest.spl Xtest', 'E759:')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
734
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
735 " Both SAL and SOFOFROM/SOFOTO items
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
736 call writefile(['SOFOFROM abcd', 'SOFOTO ABCD', 'SAL CIA X'], 'Xtest.aff')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
737 let output = execute('mkspell! Xtest.spl Xtest')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
738 call assert_match('Both SAL and SOFO lines in Xtest.aff', output)
21945
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
739
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
740 " use an alphabet flag when FLAG is num
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
741 call writefile(['FLAG num', 'SFX L Y 1', 'SFX L 0 re [^x]'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
742 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
743 call assert_match('Flag is not a number in Xtest.aff line 2: L', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
744
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
745 " use number and alphabet flag when FLAG is num
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
746 call writefile(['FLAG num', 'SFX 4f Y 1', 'SFX 4f 0 re [^x]'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
747 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
748 call assert_match('Affix name too long in Xtest.aff line 2: 4f', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
749
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
750 " use a single character flag when FLAG is long
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
751 call writefile(['FLAG long', 'SFX L Y 1', 'SFX L 0 re [^x]'], 'Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
752 let output = execute('mkspell! Xtest.spl Xtest')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
753 call assert_match('Illegal flag in Xtest.aff line 2: L', output)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
754
22204
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
755 " missing character in UPP entry. The character table is used only in a
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
756 " non-utf8 encoding
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
757 call writefile(['FOL abc', 'LOW abc', 'UPP A'], 'Xtest.aff')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
758 let save_encoding = &encoding
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
759 set encoding=cp949
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
760 call assert_fails('mkspell! Xtest.spl Xtest', 'E761:')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
761 let &encoding = save_encoding
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
762
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
763 " character range doesn't match between FOL and LOW entries
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
764 call writefile(["FOL \u0102bc", 'LOW abc', 'UPP ABC'], 'Xtest.aff')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
765 let save_encoding = &encoding
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
766 set encoding=cp949
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
767 call assert_fails('mkspell! Xtest.spl Xtest', 'E762:')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
768 let &encoding = save_encoding
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
769
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
770 " character range doesn't match between FOL and UPP entries
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
771 call writefile(["FOL \u0102bc", "LOW \u0102bc", 'UPP ABC'], 'Xtest.aff')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
772 let save_encoding = &encoding
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
773 set encoding=cp949
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
774 call assert_fails('mkspell! Xtest.spl Xtest', 'E762:')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
775 let &encoding = save_encoding
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
776
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
777 " additional characters in LOW and UPP entries
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
778 call writefile(["FOL ab", "LOW abc", 'UPP ABC'], 'Xtest.aff')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
779 let save_encoding = &encoding
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
780 set encoding=cp949
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
781 call assert_fails('mkspell! Xtest.spl Xtest', 'E761:')
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
782 let &encoding = save_encoding
3a28f60258ba patch 8.2.1651: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 21947
diff changeset
783
22220
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
784 " missing UPP entry
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
785 call writefile(["FOL abc", "LOW abc"], 'Xtest.aff')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
786 let save_encoding = &encoding
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
787 set encoding=cp949
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
788 let output = execute('mkspell! Xtest.spl Xtest')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
789 call assert_match('Missing FOL/LOW/UPP line in Xtest.aff', output)
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
790 let &encoding = save_encoding
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
791
21947
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
792 " duplicate word in the .dic file
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
793 call writefile(['2', 'good', 'good', 'good'], 'Xtest.dic')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
794 call writefile(['NAME vim'], 'Xtest.aff')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
795 let output = execute('mkspell! Xtest.spl Xtest')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
796 call assert_match('First duplicate word in Xtest.dic line 3: good', output)
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
797 call assert_match('2 duplicate word(s) in Xtest.dic', output)
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
798
22220
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
799 " use multiple .aff files with different values for COMPOUNDWORDMAX and
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
800 " MIDWORD (number and string)
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
801 call writefile(['1', 'world'], 'Xtest_US.dic')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
802 call writefile(['1', 'world'], 'Xtest_CA.dic')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
803 call writefile(["COMPOUNDWORDMAX 3", "MIDWORD '-"], 'Xtest_US.aff')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
804 call writefile(["COMPOUNDWORDMAX 4", "MIDWORD '="], 'Xtest_CA.aff')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
805 let output = execute('mkspell! Xtest.spl Xtest_US Xtest_CA')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
806 call assert_match('COMPOUNDWORDMAX value differs from what is used in another .aff file', output)
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
807 call assert_match('MIDWORD value differs from what is used in another .aff file', output)
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
808 call delete('Xtest_US.dic')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
809 call delete('Xtest_CA.dic')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
810 call delete('Xtest_US.aff')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
811 call delete('Xtest_CA.aff')
37ad27fa22e7 patch 8.2.1659: spellfile code not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 22204
diff changeset
812
21945
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
813 call delete('Xtest.dic')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
814 call delete('Xtest.aff')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
815 call delete('Xtest.spl')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
816 call delete('Xtest.sug')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
817 endfunc
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
818
21887
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
819 func Test_spell_add_word()
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
820 set spellfile=
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
821 call assert_fails('spellgood abc', 'E764:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
822
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
823 set spellfile=Xtest.utf-8.add
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
824 call assert_fails('2spellgood abc', 'E765:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
825
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
826 edit Xtest.utf-8.add
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
827 call setline(1, 'sample')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
828 call assert_fails('spellgood abc', 'E139:')
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
829 set spellfile&
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
830 %bw!
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
831 endfunc
776c76599617 patch 8.2.1493: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21841
diff changeset
832
21945
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
833 " When 'spellfile' is not set, adding a new good word will automatically set
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
834 " the 'spellfile'
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
835 func Test_init_spellfile()
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
836 let save_rtp = &rtp
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
837 let save_encoding = &encoding
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
838 call mkdir('Xrtp/spell', 'p')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
839 call writefile(['vim'], 'Xrtp/spell/Xtest.dic')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
840 silent mkspell Xrtp/spell/Xtest.utf-8.spl Xrtp/spell/Xtest.dic
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
841 set runtimepath=./Xrtp
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
842 set spelllang=Xtest
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
843 set spell
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
844 silent spellgood abc
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
845 call assert_equal('./Xrtp/spell/Xtest.utf-8.add', &spellfile)
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
846 call assert_equal(['abc'], readfile('Xrtp/spell/Xtest.utf-8.add'))
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
847 call assert_true(filereadable('Xrtp/spell/Xtest.utf-8.spl'))
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
848 set spell& spelllang& spellfile&
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
849 call delete('Xrtp', 'rf')
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
850 let &encoding = save_encoding
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
851 let &rtp = save_rtp
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
852 %bw!
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
853 endfunc
9998f4e44a73 patch 8.2.1522: not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21887
diff changeset
854
21947
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
855 " Test for the 'mkspellmem' option
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
856 func Test_mkspellmem_opt()
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
857 call assert_fails('set mkspellmem=1000', 'E474:')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
858 call assert_fails('set mkspellmem=1000,', 'E474:')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
859 call assert_fails('set mkspellmem=1000,50', 'E474:')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
860 call assert_fails('set mkspellmem=1000,50,', 'E474:')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
861 call assert_fails('set mkspellmem=1000,50,10,', 'E474:')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
862 call assert_fails('set mkspellmem=1000,50,0', 'E474:')
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
863 endfunc
12952b240ec8 patch 8.2.1523: still not enough test coverage for the spell file handling
Bram Moolenaar <Bram@vim.org>
parents: 21945
diff changeset
864
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 17682
diff changeset
865 " vim: shiftwidth=2 sts=2 expandtab