-
Notifications
You must be signed in to change notification settings - Fork 1
/
neko_test.go
30 lines (26 loc) · 874 Bytes
/
neko_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
package goshikimori
import "testing"
func TestNekoSearch(t *testing.T) {
name_normal := "Lorem ipsum dolor Sit amet consectetur adipiscing Elit"
compare_normal := "lorem_ipsum_dolor_sit_amet_consectetur_adipiscing_elit"
output_normal, _ := NekoSearch(name_normal)
if output_normal == compare_normal {
t.Log("NekoSearch normal passed")
} else {
t.Error("NekoSearch normal failed")
}
name_spaces := "Lorem ipsum dolor Sit "
compare_spaces := "lorem_ipsum_dolor_sit"
output_spaces, _ := NekoSearch(name_spaces)
if output_spaces == compare_spaces {
t.Log("NekoSearch with big spaces passed")
} else {
t.Error("NekoSearch with big spaces failed")
}
_, err := NekoSearch("")
if err != nil {
t.Log("NekoSearch empty passed")
} else {
t.Error("NekoSearch empty failed")
}
}