Test ERROR handling and add constant. Fixes #92.

This commit is contained in:
Alex Bramley 2016-11-28 22:50:19 +00:00
parent be9257d323
commit 64ad58533d
2 changed files with 13 additions and 0 deletions

View File

@ -14,6 +14,7 @@ const (
CAP = "CAP" CAP = "CAP"
CTCP = "CTCP" CTCP = "CTCP"
CTCPREPLY = "CTCPREPLY" CTCPREPLY = "CTCPREPLY"
ERROR = "ERROR"
INVITE = "INVITE" INVITE = "INVITE"
JOIN = "JOIN" JOIN = "JOIN"
KICK = "KICK" KICK = "KICK"

View File

@ -99,6 +99,18 @@ func TestLineTags(t *testing.T) {
in string in string
out *Line 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 { // Make sure non-tagged lines work
":nick!ident@host.com PRIVMSG me :Hello", ":nick!ident@host.com PRIVMSG me :Hello",
&Line{ &Line{