-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
test: add cases for unescape & unescapeBuffer #11326
Conversation
test/parallel/test-querystring.js
Outdated
@@ -304,6 +310,9 @@ assert.strictEqual( | |||
qs.stringify(obj, null, null, { encodeURIComponent: demoEncode }), | |||
'a=a&b=b&c=c'); | |||
|
|||
// Test QueryString.unescapeBuffer | |||
assert.strictEqual(qs.unescape('%C4%97%'), 'ė%'); |
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'd prefer having more direct tests against qs.unescapeBuffer()
in addition to the indirect ones for qs.unescape()
. Here are some nice test cases for unescapeBuffer()
.
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.
Thanks for pointing them! I've picked them and updated the test.
@TimothyGu ... PTAL |
@watilde, sorry for not being clear. What I meant is calling |
@TimothyGu To test this line, I needed calling |
@watilde, how about both? |
These two functions in the querystring are used as a fallback. To test them, two test cases were added which make errors that will be caught.
@TimothyGu Ahh that's nice! I will add it to call the both methods. |
Updates:
|
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.
LGTM
These two functions in the querystring are used as a fallback. To test them, two test cases were added which make errors that will be caught. PR-URL: #11326 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
landed in 02acea9 |
These two functions in the querystring are used as a fallback. To test them, two test cases were added which make errors that will be caught. PR-URL: nodejs#11326 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
These two functions in the querystring are used as a fallback. To test them, two test cases were added which make errors that will be caught. PR-URL: #11326 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This will need a backport PR if it needs to land on v4.x-staging |
These two functions in the querystring are used as a fallback. To test them, two test cases were added which make errors that will be caught. PR-URL: #11326 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Increase coverage of querystring:
This test case will cover these lines:
node/lib/querystring.js
Line 114 in 4cafa60
node/lib/querystring.js
Line 462 in 4cafa60
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test, querystring