X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fnet%2Fnetip%2Fnetip_test.go;h=36e57ce17147faad141f0ef28a495c68a05d649a;hb=f83bbaf3af8d938bd15429254bbbdcc6d4b42144;hp=39893e0f6df5567bde7207fa459b2159a9cd0e4c;hpb=8a360d68c41f9afd3749636f9fd76802e697832d;p=gostls13.git diff --git a/src/net/netip/netip_test.go b/src/net/netip/netip_test.go index 39893e0f6d..36e57ce171 100644 --- a/src/net/netip/netip_test.go +++ b/src/net/netip/netip_test.go @@ -1456,7 +1456,7 @@ func TestParsePrefixError(t *testing.T) { }, { prefix: "1.1.1.0/-1", - errstr: "out of range", + errstr: "bad bits", }, { prefix: "1.1.1.0/33", @@ -1475,6 +1475,22 @@ func TestParsePrefixError(t *testing.T) { prefix: "2001:db8::%a/32", errstr: "zones cannot be present", }, + { + prefix: "1.1.1.0/+32", + errstr: "bad bits", + }, + { + prefix: "1.1.1.0/-32", + errstr: "bad bits", + }, + { + prefix: "1.1.1.0/032", + errstr: "bad bits", + }, + { + prefix: "1.1.1.0/0032", + errstr: "bad bits", + }, } for _, test := range tests { t.Run(test.prefix, func(t *testing.T) {