mistralmail / mistralmail

Mailserver written in Go

Home Page:https://mistralmail.be

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What should UnknownCmd contain?

trtstm opened this issue · comments

For example sending this command:

UNKN some unknown command

The parser creates this Command from it (note the \n): UnknownCmd{Cmd: "UNKN some unknown command\n"}.
I think it should not include the newline in the Cmd member. If this is changed we just have to change some expected values from the parser's tests.

Ok, maybe we should (as you suggested) remove the info strings from the tests...

I changed UnknownCmd and removed all the messages / variables from the tests for the invalid and unknown commands.

type UnknownCmd struct {
    // The command
    Cmd string
    Line string
}

The tests only check for the types now...

Close it if it's ok for you, @trtstm.