pull/787/merge
Darien Raymond 7 years ago
parent 7078f23291
commit 35545cb2db
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -85,20 +85,20 @@ func TestUDPServer(t *testing.T) {
common.Must(space.Initialize()) common.Must(space.Initialize())
common.Must(space.Start()) common.Must(space.Start())
server := FromSpace(space) ips, err := net.LookupIP("google.com")
assert(server, IsNotNil) assert(err, IsNil)
ips := server.Get("google.com")
assert(len(ips), Equals, 1) assert(len(ips), Equals, 1)
assert([]byte(ips[0]), Equals, []byte{8, 8, 8, 8}) assert([]byte(ips[0]), Equals, []byte{8, 8, 8, 8})
ips = server.Get("facebook.com") ips, err = net.LookupIP("facebook.com")
assert(err, IsNil)
assert(len(ips), Equals, 1) assert(len(ips), Equals, 1)
assert([]byte(ips[0]), Equals, []byte{9, 9, 9, 9}) assert([]byte(ips[0]), Equals, []byte{9, 9, 9, 9})
dnsServer.Shutdown() dnsServer.Shutdown()
ips = server.Get("google.com") ips, err = net.LookupIP("google.com")
assert(err, IsNil)
assert(len(ips), Equals, 1) assert(len(ips), Equals, 1)
assert([]byte(ips[0]), Equals, []byte{8, 8, 8, 8}) assert([]byte(ips[0]), Equals, []byte{8, 8, 8, 8})
} }

Loading…
Cancel
Save