| ... | @@ -129,15 +129,16 @@ test "parse and render IPv6 addresses" { | ... | @@ -129,15 +129,16 @@ test "parse and render IPv6 addresses" { |
| 129 | try testing.expectError(error.InvalidIpv4Mapping, net.Address.parseIp6("::123.123.123.123", 0)); | 129 | try testing.expectError(error.InvalidIpv4Mapping, net.Address.parseIp6("::123.123.123.123", 0)); |
| 130 | try testing.expectError(error.Incomplete, net.Address.parseIp6("1", 0)); | 130 | try testing.expectError(error.Incomplete, net.Address.parseIp6("1", 0)); |
| 131 | // TODO Make this test pass on other operating systems. | 131 | // TODO Make this test pass on other operating systems. |
| 132 | if (builtin.os.tag == .linux or comptime builtin.os.tag.isDarwin()) { | 132 | if (builtin.os.tag == .linux or comptime builtin.os.tag.isDarwin() or builtin.os.tag == .windows) { |
| 133 | try testing.expectError(error.Incomplete, net.Address.resolveIp6("ff01::fb%", 0)); | 133 | try testing.expectError(error.Incomplete, net.Address.resolveIp6("ff01::fb%", 0)); |
| 134 | try testing.expectError(error.Overflow, net.Address.resolveIp6("ff01::fb%wlp3s0s0s0s0s0s0s0s0", 0)); | 134 | // Assumes IFNAMESIZE will always be a multiple of 2 |
| | 135 | try testing.expectError(error.Overflow, net.Address.resolveIp6("ff01::fb%wlp3" ++ "s0" ** @divExact(std.posix.IFNAMESIZE - 4, 2), 0)); |
| 135 | try testing.expectError(error.Overflow, net.Address.resolveIp6("ff01::fb%12345678901234", 0)); | 136 | try testing.expectError(error.Overflow, net.Address.resolveIp6("ff01::fb%12345678901234", 0)); |
| 136 | } | 137 | } |
| 137 | } | 138 | } |
| 138 | | 139 | |
| 139 | test "invalid but parseable IPv6 scope ids" { | 140 | test "invalid but parseable IPv6 scope ids" { |
| 140 | if (builtin.os.tag != .linux and comptime !builtin.os.tag.isDarwin()) { | 141 | if (builtin.os.tag != .linux and comptime !builtin.os.tag.isDarwin() and builtin.os.tag != .windows) { |
| 141 | // Currently, resolveIp6 with alphanumerical scope IDs only works on Linux. | 142 | // Currently, resolveIp6 with alphanumerical scope IDs only works on Linux. |
| 142 | // TODO Make this test pass on other operating systems. | 143 | // TODO Make this test pass on other operating systems. |
| 143 | return error.SkipZigTest; | 144 | return error.SkipZigTest; |
| ... | @@ -261,7 +262,7 @@ test "listen on a port, send bytes, receive bytes" { | ... | @@ -261,7 +262,7 @@ test "listen on a port, send bytes, receive bytes" { |
| 261 | } | 262 | } |
| 262 | | 263 | |
| 263 | test "listen on an in use port" { | 264 | test "listen on an in use port" { |
| 264 | if (builtin.os.tag != .linux and comptime !builtin.os.tag.isDarwin()) { | 265 | if (builtin.os.tag != .linux and comptime !builtin.os.tag.isDarwin() and builtin.os.tag != .windows) { |
| 265 | // TODO build abstractions for other operating systems | 266 | // TODO build abstractions for other operating systems |
| 266 | return error.SkipZigTest; | 267 | return error.SkipZigTest; |
| 267 | } | 268 | } |