diff options
Diffstat (limited to 'src/net/netip/netip_test.go')
-rw-r--r-- | src/net/netip/netip_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net/netip/netip_test.go b/src/net/netip/netip_test.go index e75f07d8c2..a52960038e 100644 --- a/src/net/netip/netip_test.go +++ b/src/net/netip/netip_test.go @@ -9,7 +9,6 @@ import ( "encoding/json" "flag" "fmt" - "internal/intern" "internal/testenv" "net" . "net/netip" @@ -18,6 +17,7 @@ import ( "sort" "strings" "testing" + "unique" ) var long = flag.Bool("long", false, "run long tests") @@ -113,18 +113,18 @@ func TestParseAddr(t *testing.T) { // IPv6 with a zone specifier. { in: "fd7a:115c:a1e0:ab12:4843:cd96:626b:430b%eth0", - ip: MkAddr(Mk128(0xfd7a115ca1e0ab12, 0x4843cd96626b430b), intern.Get("eth0")), + ip: MkAddr(Mk128(0xfd7a115ca1e0ab12, 0x4843cd96626b430b), unique.Make(AddrDetail{IsV6: true, ZoneV6: "eth0"})), }, // IPv6 with dotted decimal and zone specifier. { in: "1:2::ffff:192.168.140.255%eth1", - ip: MkAddr(Mk128(0x0001000200000000, 0x0000ffffc0a88cff), intern.Get("eth1")), + ip: MkAddr(Mk128(0x0001000200000000, 0x0000ffffc0a88cff), unique.Make(AddrDetail{IsV6: true, ZoneV6: "eth1"})), str: "1:2::ffff:c0a8:8cff%eth1", }, // 4-in-6 with zone { in: "::ffff:192.168.140.255%eth1", - ip: MkAddr(Mk128(0, 0x0000ffffc0a88cff), intern.Get("eth1")), + ip: MkAddr(Mk128(0, 0x0000ffffc0a88cff), unique.Make(AddrDetail{IsV6: true, ZoneV6: "eth1"})), str: "::ffff:192.168.140.255%eth1", }, // IPv6 with capital letters. @@ -1677,7 +1677,7 @@ var parseBenchInputs = []struct { } func BenchmarkParseAddr(b *testing.B) { - sinkInternValue = intern.Get("eth1") // Pin to not benchmark the intern package + sinkInternValue = unique.Make(AddrDetail{IsV6: true, ZoneV6: "eth1"}) // Pin to not benchmark the intern package for _, test := range parseBenchInputs { b.Run(test.name, func(b *testing.B) { b.ReportAllocs() @@ -1962,7 +1962,7 @@ var ( sinkAddrPort AddrPort sinkPrefix Prefix sinkPrefixSlice []Prefix - sinkInternValue *intern.Value + sinkInternValue unique.Handle[AddrDetail] sinkIP16 [16]byte sinkIP4 [4]byte sinkBool bool |