forked from geeksbaek/goinside
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search_test.go
38 lines (32 loc) · 736 Bytes
/
search_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
package goinside
import "testing"
func TestSearch(t *testing.T) {
l, err := Search("programming", "ㅇㅇ")
if err != nil {
t.Fatal(err)
}
if len(l.Items) == 0 {
t.Error("검색 결과가 없습니다.")
}
t.Log("Search Done.")
_, err = SearchBySubject("programming", "ㅇㅇ")
if err != nil {
t.Error(err)
}
t.Log("SearchBySubject Done.")
_, err = SearchByContent("programming", "ㅇㅇ")
if err != nil {
t.Error(err)
}
t.Log("SearchByContent Done.")
_, err = SearchBySubjectAndContent("programming", "ㅇㅇ")
if err != nil {
t.Error(err)
}
t.Log("SearchBySubjectAndContent Done.")
_, err = SearchByAuthor("programming", "ㅇㅇ")
if err != nil {
t.Error(err)
}
t.Log("SearchByAuthor Done.")
}