-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: cases to querystring related to empty string #11329
Conversation
test/parallel/test-querystring.js
Outdated
check(qs.parse(), {}); | ||
|
||
// empty sep | ||
check(qs.parse('a', []), { a: '' }) |
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.
Please add a semicolon to this line;)
test/parallel/test-querystring.js
Outdated
check(qs.parse('a', []), { a: '' }) | ||
|
||
// empty eq | ||
check(qs.parse('a', null, []), { '': 'a' }) |
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.
same here
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.
Oops, sorry for both of them... I've updated immediately.
6540045
to
e06dcc4
Compare
test/parallel/test-querystring.js
Outdated
@@ -232,8 +232,20 @@ assert.doesNotThrow(function() { | |||
assert.strictEqual(f, 'a:b;q:x%3Ay%3By%3Az'); | |||
} | |||
|
|||
// empty string | |||
assert.strictEqual('', qs.stringify()); |
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.
Nit: can you please swap the parameters? actual
first, then expected
.
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.
Sure thing!
+ Add cases to `qs.stringify` that return empty string + Add cases to `qs.parse` when `sep` or `eq` is empty
e06dcc4
to
5e8627c
Compare
+ Add cases to `qs.stringify` that return empty string + Add cases to `qs.parse` when `sep` or `eq` is empty PR-URL: #11329 Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Landed in eec216f |
+ Add cases to `qs.stringify` that return empty string + Add cases to `qs.parse` when `sep` or `eq` is empty PR-URL: nodejs#11329 Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
+ Add cases to `qs.stringify` that return empty string + Add cases to `qs.parse` when `sep` or `eq` is empty PR-URL: #11329 Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
+ Add cases to `qs.stringify` that return empty string + Add cases to `qs.parse` when `sep` or `eq` is empty PR-URL: #11329 Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
+ Add cases to `qs.stringify` that return empty string + Add cases to `qs.parse` when `sep` or `eq` is empty PR-URL: #11329 Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Increase coverage of querystring:
This test case will cover these lines:
node/lib/querystring.js
Line 250 in 4cafa60
node/lib/querystring.js
Line 254 in 4cafa60
Together with #11326, the coverage will be 100%.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)