summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0200
blob: e02ced27a61d0cf3140ca24ba93be329fd9f80f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0200
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0200
Problem:    spellbadword() not tested.
Solution:   Add a test. (Dominique Pelle, closes #3235)
Files:      src/testdir/test_spell.vim


*** ../vim-8.1.0199/src/testdir/test_spell.vim	2017-12-21 20:24:51.000000000 +0100
--- src/testdir/test_spell.vim	2018-07-20 23:33:17.188338957 +0200
***************
*** 68,73 ****
--- 68,114 ----
    bwipe!
  endfunc
  
+ " Test spellbadword() with argument
+ func Test_spellbadword()
+   set spell
+ 
+   call assert_equal(['bycycle', 'bad'],  spellbadword('My bycycle.'))
+   call assert_equal(['another', 'caps'], spellbadword('A sentence. another sentence'))
+ 
+   set spelllang=en
+   call assert_equal(['', ''],            spellbadword('centre'))
+   call assert_equal(['', ''],            spellbadword('center'))
+   set spelllang=en_us
+   call assert_equal(['centre', 'local'], spellbadword('centre'))
+   call assert_equal(['', ''],            spellbadword('center'))
+   set spelllang=en_gb
+   call assert_equal(['', ''],            spellbadword('centre'))
+   call assert_equal(['center', 'local'], spellbadword('center'))
+ 
+   " Create a small word list to test that spellbadword('...')
+   " can return ['...', 'rare'].
+   e Xwords
+   insert
+ foo
+ foobar/?
+ .
+    w!
+    mkspell! Xwords.spl Xwords
+    set spelllang=Xwords.spl
+    call assert_equal(['foobar', 'rare'], spellbadword('foo foobar'))
+ 
+   " Typo should not be detected without the 'spell' option.
+   set spelllang=en_gb nospell
+   call assert_equal(['', ''], spellbadword('centre'))
+   call assert_equal(['', ''], spellbadword('My bycycle.'))
+   call assert_equal(['', ''], spellbadword('A sentence. another sentence'))
+ 
+   call delete('Xwords.spl')
+   call delete('Xwords')
+   set spelllang&
+   set spell&
+ endfunc
+ 
  func Test_spellreall()
    new
    set spell
*** ../vim-8.1.0199/src/version.c	2018-07-20 20:28:44.855379332 +0200
--- src/version.c	2018-07-20 23:34:21.732001781 +0200
***************
*** 791,792 ****
--- 791,794 ----
  {   /* Add new patch number below this line */
+ /**/
+     200,
  /**/

-- 
The greatest lies of all time:
  (1) The check is in the mail.
  (2) We have a really challenging assignment for you.
  (3) I love you.
  (4) All bugs have been fixed.
  (5) This won't hurt a bit.
  (6) Honey, I just need to debug this program and be home in 5 minutes.
  (7) I have just sent you an e-mail about that.
  (8) Of course I'll respect you in the morning.
  (9) I'm from the government, and I'm here to help you.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///