Skip to content

Commit

Permalink
ip-parser: handle zone-id (by ignoring it for the moment)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Nov 5, 2024
1 parent fc41d54 commit 15402d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions basis/ip-parser/ip-parser-tests.factor
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ USING: ip-parser kernel sequences tools.test ;
{ "1::" } [ 0x10000000000000000000000000000 ipv6-ntoa ] unit-test
{ 0x10002000000000000000000030004 } [ "1:2::3:4" ipv6-aton ] unit-test
{ "1:2::3:4" } [ 0x10002000000000000000000030004 ipv6-ntoa ] unit-test

{ { 65152 0 0 0 29762 6399 65122 31588 } }
[ "fe80::7442:18ff:fe62:7b64%en0" parse-ipv6 ] unit-test
1 change: 1 addition & 0 deletions basis/ip-parser/ip-parser.factor
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ ERROR: more-than-8-components ;
PRIVATE>

: parse-ipv6 ( string -- seq )
"%" split1 drop ! XXX: parse the zone-id
"::" split1 [ [ f ] [ split-ipv6 ] if-empty ] bi@ pad-ipv6 ;

: ipv6-ntoa ( integer -- ip )
Expand Down

0 comments on commit 15402d0

Please sign in to comment.