diff options
author | Patrick Spek <p.spek@tyil.nl> | 2023-01-23 10:19:49 +0100 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2023-01-23 10:19:49 +0100 |
commit | a2fb1f7bd00dbefdd3009ca5b6cec4f5985e0718 (patch) | |
tree | 438f02276da629f7f911ba364b15b9acde245248 | |
parent | 121731baf33064577dfea15976489cf64ef5fb8e (diff) | |
download | irc-grammar-a2fb1f7bd00dbefdd3009ca5b6cec4f5985e0718.tar.gz irc-grammar-a2fb1f7bd00dbefdd3009ca5b6cec4f5985e0718.tar.bz2 |
-rw-r--r-- | lib/IRC/Grammar.pm6 | 2 | ||||
-rw-r--r-- | t/network-freenode.t | 18 | ||||
-rw-r--r-- | t/rfc1459.t | 0 |
3 files changed, 19 insertions, 1 deletions
diff --git a/lib/IRC/Grammar.pm6 b/lib/IRC/Grammar.pm6 index f859edc..0bc86f7 100644 --- a/lib/IRC/Grammar.pm6 +++ b/lib/IRC/Grammar.pm6 @@ -28,7 +28,7 @@ token host { <hostname> | <hostaddr> } token hostname { <shortname> [ '.' <shortname> ]* '.'? } token hostaddr { <ip6addr> | <ip4addr> } token ip4addr { [ \d ** 1..3 ] ** 4 % '.' } -token ip6addr { [ <[ \d a..f A..F ]> ** 1..4 ] ** 8 % ':' } +token ip6addr { [ <[ \d a..f A..F ]> ** 1..4 ] ** 1..8 % [ '::' | ':' ] } token shortname { <[ \w \d / ]> <[ \w \d / \- ]>* <[ \w \d / ]>? } token nospcrlfcl { <-[ \0 \r \n \s : ]> } diff --git a/t/network-freenode.t b/t/network-freenode.t new file mode 100644 index 0000000..b9e32a5 --- /dev/null +++ b/t/network-freenode.t @@ -0,0 +1,18 @@ +#!/usr/bin/env raku + +use Test; + +use IRC::Grammar; + +plan 1; + +subtest ':Geth!~raku@2a01:4f9:c010:e20c::1 JOIN #raku-dev', { + plan 4; + + my $match = IRC::Grammar.parse(':Geth!~raku@2a01:4f9:c010:e20c::1 JOIN #raku-dev'); + + ok $match; + is $match<prefix>, 'Geth!~raku@2a01:4f9:c010:e20c::1'; + is $match<command>, 'JOIN'; + is $match<params>[0], '#raku-dev'; +} diff --git a/t/rfc1459.t b/t/rfc1459.t deleted file mode 100644 index e69de29..0000000 --- a/t/rfc1459.t +++ /dev/null |