forked from client9/misspell
-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
falsepositives_test.go
143 lines (138 loc) · 2.59 KB
/
falsepositives_test.go
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
package misspell
import (
"testing"
)
func TestFalsePositives(t *testing.T) {
testCases := []string{
"importEnd",
"drinkeries",
"subscripting",
"unprojected",
"updaters",
"templatize",
"requesters",
"requestors",
"replicaset",
"parallelise",
"parallelize",
"perceptron", // http://foldoc.org/perceptron
"perceptrons", // ^^
"convertors", // alt spelling
"adventurers",
" s.svc.GetObject ",
"infinitie.net",
"foo summaries\n",
"thru",
"publically",
"6YUO5", // base64
"cleaner", // triggered by "cleane->cleanser" and partial word FP
" http.Redirect(w, req, req.URL.Path, http.StatusFound) ",
"url is http://zeebra.com ",
"path is /zeebra?zeebra=zeebra ",
"Malcom_McLean",
"implementor", // alt spelling, see https://github.com/client9/misspell/issues/46
"searchtypes",
" witness",
"returndata",
"UNDERSTOOD",
"textinterface",
" committed ",
"committed",
"Bengali",
"Portuguese",
"scientists",
"causally",
"embarrassing",
"setuptools", // python package
"committing",
"guises",
"disguise",
"begging",
"cmo",
"cmos",
"borked",
"hadn't",
"Iceweasel",
"summarised",
"autorenew",
"travelling",
"republished",
"fallthru",
"pruning",
"deb.VersionDontCare",
"authtag",
"intrepid",
"usefully",
"there",
"definite",
"earliest",
"Japanese",
"international",
"excellent",
"gracefully",
"carefully",
"class",
"include",
"process",
"address",
"attempt",
"large",
"although",
"specific",
"taste",
"against",
"successfully",
"unsuccessfully",
"occurred",
"agree",
"controlled",
"publisher",
"strategy",
"geoposition",
"paginated",
"happened",
"relative",
"computing",
"language",
"manual",
"token",
"into",
"nothing",
"datatool",
"propose",
"learnt",
"tolerant",
"whitehat",
"monotonic",
"comprised",
"indemnity",
"flattened",
"interrupted",
"inotify",
"occasional",
"forging",
"ampersand",
"decomposition",
"commit",
"programmer", // "grammer"
// "requestsinserted",
"seeked", // technical word
"bodyreader", // variable name
"cantPrepare", // variable name
"dontPrepare", // variable name
"\\nto", // https://github.com/client9/misspell/issues/93
"4f8b42c22dd3729b519ba6f68d2da7cc5b2d606d05daed5ad5128cc03e6c6358", // https://github.com/client9/misspell/issues/97
}
r := New()
r.Debug = true
for _, test := range testCases {
test := test
t.Run(test, func(t *testing.T) {
t.Parallel()
got, _ := r.Replace(test)
if got != test {
t.Errorf("%q got converted to %q", test, got)
}
})
}
}