dnsquery/cmd/server/main_test.go
Ubuntu ec23258cc9 feat: launch DNS query MVP
Co-authored-by: multica-agent <github@multica.ai>
2026-08-03 17:42:44 +00:00

6 lines
424 B
Go

package main
import "testing"
func TestNormalizeDomain(t *testing.T){tests:=[]struct{in,want string;ok bool}{{"https://WWW.Example.com/path","www.example.com",true},{"example.com/","example.com",true},{"localhost","",false},{"127.0.0.1","",false},{"bad_domain.com","",false}};for _,tt:=range tests{got,err:=normalizeDomain(tt.in);if (err==nil)!=tt.ok||got!=tt.want{t.Errorf("normalizeDomain(%q)=(%q,%v)",tt.in,got,err)}}}