From a2fb1f7bd00dbefdd3009ca5b6cec4f5985e0718 Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Mon, 23 Jan 2023 10:19:49 +0100
Subject: Apply updates I had laying around
---
lib/IRC/Grammar.pm6 | 2 +-
t/network-freenode.t | 18 ++++++++++++++++++
t/rfc1459.t | 0
3 files changed, 19 insertions(+), 1 deletion(-)
create mode 100644 t/network-freenode.t
delete mode 100644 t/rfc1459.t
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 { | }
token hostname { [ '.' ]* '.'? }
token hostaddr { | }
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, 'Geth!~raku@2a01:4f9:c010:e20c::1';
+ is $match, 'JOIN';
+ is $match[0], '#raku-dev';
+}
diff --git a/t/rfc1459.t b/t/rfc1459.t
deleted file mode 100644
index e69de29..0000000
--
cgit v1.1