From 64ad58533df555ea5e1f89db2a401e021df8dea0 Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Mon, 28 Nov 2016 22:50:19 +0000 Subject: [PATCH] Test ERROR handling and add constant. Fixes #92. --- client/commands.go | 1 + client/line_test.go | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/client/commands.go b/client/commands.go index 85cca5f..101c7d3 100644 --- a/client/commands.go +++ b/client/commands.go @@ -14,6 +14,7 @@ const ( CAP = "CAP" CTCP = "CTCP" CTCPREPLY = "CTCPREPLY" + ERROR = "ERROR" INVITE = "INVITE" JOIN = "JOIN" KICK = "KICK" diff --git a/client/line_test.go b/client/line_test.go index 82132d1..88b758d 100644 --- a/client/line_test.go +++ b/client/line_test.go @@ -99,6 +99,18 @@ func TestLineTags(t *testing.T) { in string out *Line }{ + { // Make sure ERROR lines work + "ERROR :Closing Link: example.org (Too many user connections (global))", + &Line{ + Nick: "", + Ident: "", + Host: "", + Src: "", + Cmd: ERROR, + Raw: "ERROR :Closing Link: example.org (Too many user connections (global))", + Args: []string{"Closing Link: example.org (Too many user connections (global))"}, + }, + }, { // Make sure non-tagged lines work ":nick!ident@host.com PRIVMSG me :Hello", &Line{