-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfind_mappings_test.go
43 lines (41 loc) · 993 Bytes
/
find_mappings_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
package homoglyphr
import "testing"
//TODO: Clean up this test lol
func TestFindAllMappings(t *testing.T) {
var mappings = FindAllMappings("google")
var counter = 0
for _ = range mappings {
counter++
}
if counter != 4 {
t.Error("Unable to find all related character mappings")
}
counter = 0
for _ = range mappings["g"] {
counter++
}
if counter != 11 {
t.Error("Unable to find correct number of related character mappings for this 'fella 'g'")
}
counter = 0
for _ = range mappings["o"] {
counter++
}
if counter != 44 {
t.Error("Unable to find correct number of related character mappings for this 'fella 'o'")
}
counter = 0
for _ = range mappings["l"] {
counter++
}
if counter != 13 {
t.Error("Unable to find correct number of related character mappings for this 'fella 'l'")
}
counter = 0
for _ = range mappings["e"] {
counter++
}
if counter != 30 {
t.Error("Unable to find correct number of related character mappings for this 'fella 'e'")
}
}