| 12345678910111213141516171819202122232425262728 | 
							- package search
 
- import (
 
- 	"encoding/json"
 
- 	"fmt"
 
- 	"testing"
 
- )
 
- func TestSearch(t *testing.T) {
 
- 	text := "抗体"
 
- 	result, err := Query(text, 1, 0, 5, false)
 
- 	if err != nil {
 
- 		t.Fatal(err)
 
- 	}
 
- 	buf, _ := json.Marshal(result)
 
- 	fmt.Println(string(buf))
 
- }
 
- func TestGetTip(t *testing.T) {
 
- 	text := "胃"
 
- 	result, err := GetSearchTips(text, 1)
 
- 	if err != nil {
 
- 		t.Fatal(err)
 
- 	}
 
- 	buf, _ := json.Marshal(result)
 
- 	fmt.Println(string(buf))
 
- }
 
 
  |