From b1cabbc6d481c3ca1aa2aa19dd2c7caf85404316 Mon Sep 17 00:00:00 2001 From: tsosunchia <59512455+tsosunchia@users.noreply.github.com> Date: Fri, 2 Jun 2023 13:49:15 +0800 Subject: [PATCH] =?UTF-8?q?pow=5Ftest=E5=A2=9E=E5=8A=A0=E8=AE=A1=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pow/pow_test.go | 8 +++++++- util/dns_test.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pow/pow_test.go b/pow/pow_test.go index 51dc034..72b63c9 100644 --- a/pow/pow_test.go +++ b/pow/pow_test.go @@ -4,10 +4,16 @@ import ( "fmt" "github.com/stretchr/testify/assert" "testing" + "time" ) func TestGetToken(t *testing.T) { + // 计时开始 + start := time.Now() token, err := GetToken("103.120.18.35", "api.leo.moe", "443") - fmt.Println(token, err) + // 计时结束 + end := time.Now() + fmt.Println("耗时:", end.Sub(start)) + fmt.Println("token:", token) assert.NoError(t, err, "GetToken() returned an error") } diff --git a/util/dns_test.go b/util/dns_test.go index 9730b34..bac2443 100644 --- a/util/dns_test.go +++ b/util/dns_test.go @@ -8,6 +8,6 @@ import ( func TestDNS(t *testing.T) { resolver := DNSSB() - ips, _ := resolver.LookupHost(context.Background(), "www.google.com") + ips, _ := resolver.LookupHost(context.Background(), "www.bing.com") fmt.Println(ips) }