acfunction_go/pkg/acfun_api_test.go

24 lines
378 B
Go
Raw Permalink Normal View History

2024-06-18 23:30:03 -07:00
package acfun_api
import (
"fmt"
"net/http"
"testing"
)
func TestGetDanmaku(t *testing.T) {
client := &http.Client{}
danmakus, err := GetDanmaku(client, "12528563")
if err != nil {
t.Fatal(err)
}
t.Log(len(danmakus))
// fmt.Println(danmakus)
for _, danmaku := range danmakus {
fmt.Println(danmaku)
}
if len(danmakus) == 0 {
t.Fatal("danmakus is empty")
}
}