| ... | @@ -13,6 +13,7 @@ test "parse and render IPv6 addresses" { | ... | @@ -13,6 +13,7 @@ test "parse and render IPv6 addresses" { |
| 13 | "FF01::Fb", | 13 | "FF01::Fb", |
| 14 | "::1", | 14 | "::1", |
| 15 | "::", | 15 | "::", |
| | 16 | "1::", |
| 16 | "2001:db8::", | 17 | "2001:db8::", |
| 17 | "::1234:5678", | 18 | "::1234:5678", |
| 18 | "2001:db8::1234:5678", | 19 | "2001:db8::1234:5678", |
| ... | @@ -24,6 +25,7 @@ test "parse and render IPv6 addresses" { | ... | @@ -24,6 +25,7 @@ test "parse and render IPv6 addresses" { |
| 24 | "ff01::fb", | 25 | "ff01::fb", |
| 25 | "::1", | 26 | "::1", |
| 26 | "::", | 27 | "::", |
| | 28 | "1::", |
| 27 | "2001:db8::", | 29 | "2001:db8::", |
| 28 | "::1234:5678", | 30 | "::1234:5678", |
| 29 | "2001:db8::1234:5678", | 31 | "2001:db8::1234:5678", |
| ... | @@ -48,6 +50,7 @@ test "parse and render IPv6 addresses" { | ... | @@ -48,6 +50,7 @@ test "parse and render IPv6 addresses" { |
| 48 | try testing.expectError(error.InvalidEnd, net.Address.parseIp6("FF01:0:0:0:0:0:0:FB:", 0)); | 50 | try testing.expectError(error.InvalidEnd, net.Address.parseIp6("FF01:0:0:0:0:0:0:FB:", 0)); |
| 49 | try testing.expectError(error.Incomplete, net.Address.parseIp6("FF01:", 0)); | 51 | try testing.expectError(error.Incomplete, net.Address.parseIp6("FF01:", 0)); |
| 50 | try testing.expectError(error.InvalidIpv4Mapping, net.Address.parseIp6("::123.123.123.123", 0)); | 52 | try testing.expectError(error.InvalidIpv4Mapping, net.Address.parseIp6("::123.123.123.123", 0)); |
| | 53 | try testing.expectError(error.Incomplete, net.Address.parseIp6("1", 0)); |
| 51 | // TODO Make this test pass on other operating systems. | 54 | // TODO Make this test pass on other operating systems. |
| 52 | if (builtin.os.tag == .linux or comptime builtin.os.tag.isDarwin()) { | 55 | if (builtin.os.tag == .linux or comptime builtin.os.tag.isDarwin()) { |
| 53 | try testing.expectError(error.Incomplete, net.Address.resolveIp6("ff01::fb%", 0)); | 56 | try testing.expectError(error.Incomplete, net.Address.resolveIp6("ff01::fb%", 0)); |