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"
CTCP = "CTCP"
CTCPREPLY = "CTCPREPLY"
ERROR = "ERROR"
INVITE = "INVITE"
JOIN = "JOIN"
KICK = "KICK"

View File

@ -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{