-
Notifications
You must be signed in to change notification settings - Fork 37.8k
test: Add two more urlDecode tests #29967
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
Code review ACK fa55972 |
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.
ACK fa55972
ACK fa55972 super-mini-nit: In the commit message, |
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.
utACK fa55972
@@ -54,6 +54,9 @@ BOOST_AUTO_TEST_CASE(decode_malformed_test) { | |||
BOOST_CHECK_EQUAL(UrlDecode(" %Z "), " %Z "); | |||
BOOST_CHECK_EQUAL(UrlDecode(" % X"), " % X"); | |||
|
|||
BOOST_CHECK_EQUAL(UrlDecode("%%ffg"), "%\xffg"); |
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 had to scratch my head on this one...
It iterates from left to right, the first thing it finds is %
. It then tries if the next two characters are hex, which they are not, so it puts the literal %
in the result. Then it moves to the next %
which is followed by valid hex ff
. Since 0xff
is invalid unicode, we have to represent it with the escape sequence "\xff"
. And then there's the regular character g
.
Trivial follow-up after #29904 (comment)