Prevent panicing when parsing invalid messages
This commit is contained in:
parent
cf759883aa
commit
83056c5396
2 changed files with 14 additions and 1 deletions
|
@ -71,3 +71,10 @@ func TestParseMessage(t *testing.T) {
|
|||
assert.Equal(t, tc.expected, parseMessage(tc.input))
|
||||
}
|
||||
}
|
||||
|
||||
func TestBadMessagePanic(t *testing.T) {
|
||||
parseMessage(":user\r\n")
|
||||
parseMessage(":\r\n")
|
||||
parseMessage(":")
|
||||
parseMessage("")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue