fix: 修复在非对应IP类型时进行无效检测依然输出的问题

This commit is contained in:
spiritlhl committed 2025-06-29 02:44:20 +00:00
1 parent be226cf042
commit ebf837c8a8
3 files changed
+190 -2

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
package utils
import (
"fmt"
"testing"
"time"
)
func TestCheckPublicAccess(t *testing.T) {
timeout := 3 * time.Second
result := CheckPublicAccess(timeout)
if result.Connected {
fmt.Printf("✅ 本机有公网连接,类型: %s\n", result.StackType)
} else {
fmt.Println("❌ 本机未检测到公网连接")
}
}