summaryrefslogtreecommitdiff
path: root/lib/std/test/ipparse.myr
diff options
context:
space:
mode:
authorFrank Smit <frank@61924.nl>2020-08-30 13:39:54 +0000
committerFrank Smit <frank@61924.nl>2020-08-30 13:39:54 +0000
commite0efab37a8bbd245e60c9adffaba4182aeb17c87 (patch)
tree3356fae8cb5d642afd3517f79ee3d61243179451 /lib/std/test/ipparse.myr
parent026a628d0ebce3d347322d629031d0fdc93308bf (diff)
downloadmc-e0efab37a8bbd245e60c9adffaba4182aeb17c87.tar.gz
Fix IPv6 parsing.
2001:b88:1202::10 resulted in [32, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] while it should be [32, 1, 11, 136, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16]
Diffstat (limited to 'lib/std/test/ipparse.myr')
-rw-r--r--lib/std/test/ipparse.myr6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/std/test/ipparse.myr b/lib/std/test/ipparse.myr
index ae23709..ad408cb 100644
--- a/lib/std/test/ipparse.myr
+++ b/lib/std/test/ipparse.myr
@@ -52,6 +52,12 @@ const main = {
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00])
+ eq("2001:b88:1202::10", \
+ `std.Some `std.Ipv6 [ \
+ 0x20, 0x01, 0x0b, 0x88, \
+ 0x12, 0x02, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x10])
/* invalid ipv4 addresses */
eq("2a03:2880:2110:df07:face:b00c:0:1:abc", `std.None) /* too long */