authorgravatar for kenta@lithdew.netlithdew <kenta@lithdew.net> 2021-04-30 22:45:10+09:00
committergravatar for kenta@lithdew.netlithdew <kenta@lithdew.net> 2021-05-03 14:49:10+09:00
logaa15699269b416f46f3c10469d842b930ac26fc9
tree16dcc755261ff21db5518ae7075014e0907d55c5
parent9a7c57144da9057c80059a3a1ec37aec44dcdc7a

x/os/net: skip ipv6 scope id parse test on unsupported platforms


1 files changed, 15 insertions(+), 1 deletions(-)

lib/std/x/os/net.zig+15-1
......@@ -532,7 +532,6 @@ test "ipv6: parse & format" {
532532 "::1234:5678",
533533 "2001:db8::1234:5678",
534534 "::ffff:123.5.123.5",
535 "FF01::FB%lo",
536535 };
537536
538537 const outputs = [_][]const u8{
......@@ -544,6 +543,21 @@ test "ipv6: parse & format" {
544543 "::1234:5678",
545544 "2001:db8::1234:5678",
546545 "::ffff:123.5.123.5",
546 };
547
548 for (inputs) |input, i| {
549 try testing.expectFmt(outputs[i], "{}", .{try IPv6.parse(input)});
550 }
551}
552
553test "ipv6: parse & format addresses with scope ids" {
554 if (!@hasDecl(os, "IFNAMESIZE")) return error.SkipZigTest;
555
556 const inputs = [_][]const u8{
557 "FF01::FB%lo",
558 };
559
560 const outputs = [_][]const u8{
547561 "ff01::fb%1",
548562 };
549563