| ... | @@ -532,7 +532,6 @@ test "ipv6: parse & format" { | ... | @@ -532,7 +532,6 @@ test "ipv6: parse & format" { |
| 532 | "::1234:5678", | 532 | "::1234:5678", |
| 533 | "2001:db8::1234:5678", | 533 | "2001:db8::1234:5678", |
| 534 | "::ffff:123.5.123.5", | 534 | "::ffff:123.5.123.5", |
| 535 | "FF01::FB%lo", | | |
| 536 | }; | 535 | }; |
| 537 | | 536 | |
| 538 | const outputs = [_][]const u8{ | 537 | const outputs = [_][]const u8{ |
| ... | @@ -544,6 +543,21 @@ test "ipv6: parse & format" { | ... | @@ -544,6 +543,21 @@ test "ipv6: parse & format" { |
| 544 | "::1234:5678", | 543 | "::1234:5678", |
| 545 | "2001:db8::1234:5678", | 544 | "2001:db8::1234:5678", |
| 546 | "::ffff:123.5.123.5", | 545 | "::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 | |
| | 553 | test "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{ |
| 547 | "ff01::fb%1", | 561 | "ff01::fb%1", |
| 548 | }; | 562 | }; |
| 549 | | 563 | |