diff --git a/locator/resolved_test.go b/locator/resolved_test.go index e525051..1dd007f 100644 --- a/locator/resolved_test.go +++ b/locator/resolved_test.go @@ -64,3 +64,12 @@ func TestResolvedIPWellKnownPrefix(t *testing.T) { } } } + +// An IPv4-mapped prefix is not one of NAT64: the texts of TypeScript and Dart +// follow this one. +func TestResolvedIPMappedPrefix(t *testing.T) { + err := locator.CheckResolvedIP(netip.MustParseAddr("8.8.8.8"), netip.MustParsePrefix("::ffff:0.0.0.0/96")) + if err == nil || err.Error() != "locator: the NAT64 prefix ::ffff:0.0.0.0/96 is not an IPv6 prefix" { + t.Fatal(err) + } +}