Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non spec compliant unit test #115

Open
RAnders00 opened this issue Dec 23, 2019 · 1 comment
Open

Non spec compliant unit test #115

RAnders00 opened this issue Dec 23, 2019 · 1 comment

Comments

@RAnders00
Copy link
Contributor

RAnders00 commented Dec 23, 2019

"Input": ":src AWAY ",
"Expected": {
"source": {
"host": "src"
},
"command": "AWAY",
"params": [
""
]
}
},

In this test, the expected output for the parameters is [""] (single element list, holding an empty string).

I think the IRC spec disagrees on this: https://tools.ietf.org/html/rfc2812#section-2.3.1
relevant part:

    params     =  *14( SPACE middle ) [ SPACE ":" trailing ]
    middle     =  nospcrlfcl *( ":" / nospcrlfcl )
    nospcrlfcl =  %x01-09 / %x0B-0C / %x0E-1F / %x21-39 / %x3B-FF
                    ; any octet except NUL, CR, LF, " " and ":"

So in essence the space between "middle" parameters is "used up" by the SPACE in the definition of params, and then middle first expects something that is not a space. From my understanding this means that multiple spaces are not allowed between middle parameters, and the IRC test under question should be an error.

@RAnders00
Copy link
Contributor Author

There is also another unit test that relies on this behaviour:

"Input": ":gravel.mozilla.org 432 #momo :Erroneous Nickname: Illegal characters",
"Expected": {
"source": {
"host": "gravel.mozilla.org"
},
"command": "432",
"params": [
"",
"#momo",
"Erroneous Nickname: Illegal characters"
]
}
},

I think this test case is taken from this bug discussion: https://bugzilla.mozilla.org/show_bug.cgi?id=954972 Where it was already discussed that sending a message like this would break IRC message parsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants