mirror of
https://github.com/fluffle/goirc
synced 2025-09-06 00:43:20 +00:00
skip empty tags, allow = in tag values, better clarify ; split, add IRCv3 tag parsing comment to ParseLine()
This commit is contained in:
parent
73f523f252
commit
20ef362b1d
2 changed files with 33 additions and 8 deletions
|
@ -137,8 +137,32 @@ func TestLineTags(t *testing.T) {
|
|||
Args: []string{"me", "Hello"},
|
||||
},
|
||||
},
|
||||
{"@a=a; :nick!ident@host.com PRIVMSG me :Hello", nil}, // Bad inputs
|
||||
{"@a=a=a :nick!ident@host.com PRIVMSG me :Hello", nil},
|
||||
{ // Skip empty tag
|
||||
"@a=a; :nick!ident@host.com PRIVMSG me :Hello",
|
||||
&Line{
|
||||
Tags: map[string]string{"a": "a"},
|
||||
Nick: "nick",
|
||||
Ident: "ident",
|
||||
Host: "host.com",
|
||||
Src: "nick!ident@host.com",
|
||||
Cmd: PRIVMSG,
|
||||
Raw: "@a=a; :nick!ident@host.com PRIVMSG me :Hello",
|
||||
Args: []string{"me", "Hello"},
|
||||
},
|
||||
},
|
||||
{ // = in tag
|
||||
"@a=a=a; :nick!ident@host.com PRIVMSG me :Hello",
|
||||
&Line{
|
||||
Tags: map[string]string{"a": "a=a"},
|
||||
Nick: "nick",
|
||||
Ident: "ident",
|
||||
Host: "host.com",
|
||||
Src: "nick!ident@host.com",
|
||||
Cmd: PRIVMSG,
|
||||
Raw: "@a=a=a; :nick!ident@host.com PRIVMSG me :Hello",
|
||||
Args: []string{"me", "Hello"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for i, test := range tests {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue