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
Tests for Rfc2616 parser #1593
Tests for Rfc2616 parser #1593
Conversation
|
||
val genText: Gen[String] = oneOf(nonEmptyListOf(oneOf(allowedText)).map(_.mkString), genLws) | ||
|
||
val allowedQDText: List[Char] = allowedText.filterNot(c => c == '"' || c == '\\') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to spec the backslash character \
is allowed but it seems the parser cannot handle one particular case where the Generated QDText ends on \"
like e.g.
"_¡1S^¼m¬Á\"
"ìÙ\"
This is certainly a border case and I couldn't figure how to make the parboiled parser handle it properly so I tweaked the generator. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly seems like we should be able to fix the parser. I don't want it to stand in the way of progress, but I'd like to leave a note so we try to fix it.
e3c7888
to
78c0887
Compare
I added a comment and a small fix for scala 2.11. It's probably a good idea to review the generators anyway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to get in here and rename the implicits according to standard, but this looks like it moves the ball forward.
Which standard? I could rename them |
This is how cats names them. I've been using |
I see, I will switch the convention. Looking at the arbitraries you can see there have been many hands involved |
Maybe it's better to do another PR with all arbitraries names fixed in on go. Shall I merge this one to get my another change as a PR? |
Yes. :) |
Tests for Rfc2616 parser
This PR starts from a change I want to do removing
Registry
fromMediaRange
. To do so I needed to generateMediaRange
instances for scalacheck, which led me to create generators for various parts of the http spec previously untested.This PR contains a test and the generators but there is one that is contentious and I'd like to get your comments