annotate src/testdir/test_spellfile.vim @ 21841:7a6ca887128d v8.2.1470

patch 8.2.1470: errors in spell file not tested Commit: https://github.com/vim/vim/commit/c0f8823ee4ca629db5446ba0a935f68d4a4fb193 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 16 21:51:49 2020 +0200 patch 8.2.1470: errors in spell file not tested Problem: Errors in spell file not tested. Solution: Add test for spell file errors. (Yegappan Lakshmanan, closes #6721)
author Bram Moolenaar <Bram@vim.org>
date Sun, 16 Aug 2020 22:00:03 +0200
parents 08940efa6b4e
children 776c76599617
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
21841
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
174 " Test for spell file format errors
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
175 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
176 let save_rtp = &rtp
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
177 call mkdir('Xtest/spell', 'p')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
178
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
179 " empty spell file
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
180 call writefile([], './Xtest/spell/Xtest.utf-8.spl')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
181 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
182 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
183 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
184 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
185
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
186 " invalid file ID
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
187 call writefile(['vim'], './Xtest/spell/Xtest.utf-8.spl')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
188 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
189 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
190 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
191 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
192
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
193 " missing version number
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
194 call writefile(['VIMspell'], './Xtest/spell/Xtest.utf-8.spl')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
195 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
196 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
197 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
198 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
199
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
200 " invalid version number
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
201 call writefile(['VIMspellz'], './Xtest/spell/Xtest.utf-8.spl')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
202 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
203 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
204 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
205 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
206
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
207 " no sections
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
208 call writefile(0z56494D7370656C6C32, './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
209 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
210 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
211 call assert_fails('set spell', 'E758:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
212 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
213
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
214 " missing section length
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
215 call writefile(['VIMspell200'], './Xtest/spell/Xtest.utf-8.spl')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
216 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
217 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
218 call assert_fails('set spell', 'E758:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
219 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
220
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
221 " unsupported required section
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
222 call writefile(['VIMspell2z' .. nr2char(1) .. ' ' .. nr2char(4)],
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
223 \ './Xtest/spell/Xtest.utf-8.spl')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
224 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
225 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
226 call assert_fails('set spell', 'E770:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
227 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
228
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
229 " unsupported not-required section
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
230 call writefile(['VIMspell2z' .. nr2char(0) .. ' ' .. nr2char(4)],
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
231 \ './Xtest/spell/Xtest.utf-8.spl')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
232 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
233 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
234 call assert_fails('set spell', 'E758:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
235 set nospell spelllang&
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 " SN_REGION: invalid number of region names
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
238 call writefile(0z56494D7370656C6C320000000000FF,
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
239 \ './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
240 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
241 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
242 call assert_fails('set spell', 'E759:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
243 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
244
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
245 " SN_CHARFLAGS: missing <charflagslen> length
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
246 call writefile(0z56494D7370656C6C32010000000004,
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
247 \ './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
248 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
249 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
250 call assert_fails('set spell', 'E758:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
251 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
252
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
253 " SN_CHARFLAGS: invalid <charflagslen> length
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
254 call writefile(0z56494D7370656C6C320100000000010201,
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
255 \ './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
256 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
257 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
258 set spell
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
259 " FIXME: There are no error messages. How to check for the test result?
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
260 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
261
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
262 " SN_CHARFLAGS: charflagslen == 0 and folcharslen != 0
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
263 call writefile(0z56494D7370656C6C3201000000000400000101,
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
264 \ './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
265 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
266 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
267 call assert_fails('set spell', 'E759:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
268 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
269
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
270 " SN_CHARFLAGS: missing <folcharslen> length
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
271 call writefile(0z56494D7370656C6C3201000000000100,
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
272 \ './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
273 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
274 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
275 call assert_fails('set spell', 'E758:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
276 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
277
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
278 " SN_PREFCOND: invalid prefcondcnt
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
279 call writefile(0z56494D7370656C6C3203000000000100,
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
280 \ './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
281 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
282 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
283 call assert_fails('set spell', 'E759:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
284 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
285
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
286 " SN_PREFCOND: invalid condlen
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
287 call writefile(0z56494D7370656C6C320300000000020001,
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
288 \ './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
289 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
290 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
291 call assert_fails('set spell', 'E759:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
292 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
293
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
294 " SN_REP: invalid repcount
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
295 call writefile(0z56494D7370656C6C3204000000000100,
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
296 \ './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
297 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
298 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
299 call assert_fails('set spell', 'E758:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
300 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
301
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
302 " SN_REP: missing rep
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
303 call writefile(0z56494D7370656C6C320400000000020004,
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
304 \ './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
305 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
306 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
307 call assert_fails('set spell', 'E758:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
308 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
309
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
310 " SN_REP: zero repfromlen
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
311 call writefile(0z56494D7370656C6C32040000000003000100,
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
312 \ './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
313 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
314 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
315 call assert_fails('set spell', 'E759:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
316 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
317
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
318 " SN_REP: invalid reptolen
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
319 call writefile(0z56494D7370656C6C320400000000050001014101,
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
320 \ './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
321 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
322 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
323 " FIXME: There are no error messages. How to check for the test result?
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
324 set spell
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
325 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
326
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
327 " SN_REP: zero reptolen
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
328 call writefile(0z56494D7370656C6C320400000000050001014100,
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
329 \ './Xtest/spell/Xtest.utf-8.spl', 'b')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
330 set runtimepath=./Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
331 set spelllang=Xtest
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
332 call assert_fails('set spell', 'E759:')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
333 set nospell spelllang&
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
334
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
335 let &rtp = save_rtp
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
336 call delete('Xtest', 'rf')
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
337 endfunc
7a6ca887128d patch 8.2.1470: errors in spell file not tested
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
338
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 17682
diff changeset
339 " vim: shiftwidth=2 sts=2 expandtab