diff options
author | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2015-03-19 18:51:55 -0400 |
---|---|---|
committer | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2015-03-19 21:45:38 -0400 |
commit | a89f5c21562fe75b083a270090eadfbe318e5954 (patch) | |
tree | 14125837ae091f197fb62f5fd9327ee8746aedeb /test/parallel/test-querystring.js | |
parent | 8de78e470d2e291454e2184d7f206c70d4cb8c97 (diff) | |
download | node-new-a89f5c21562fe75b083a270090eadfbe318e5954.tar.gz |
querystring: parse numbers correctly
Fixes a number parsing regression introduced in 85a92a3
Fixes: https://github.com/iojs/io.js/issues/1208
PR-URL: https://github.com/iojs/io.js/pull/1213
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Brian White <mscdex@mscdex.net>
Diffstat (limited to 'test/parallel/test-querystring.js')
-rw-r--r-- | test/parallel/test-querystring.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-querystring.js b/test/parallel/test-querystring.js index e2591d7090..17fa6df924 100644 --- a/test/parallel/test-querystring.js +++ b/test/parallel/test-querystring.js @@ -138,6 +138,14 @@ qsWeirdObjects.forEach(function(testCase) { assert.equal(testCase[1], qs.stringify(testCase[0])); }); +// coerce numbers to string +assert.strictEqual('foo=0', qs.stringify({ foo: 0 })); +assert.strictEqual('foo=0', qs.stringify({ foo: -0 })); +assert.strictEqual('foo=3', qs.stringify({ foo: 3 })); +assert.strictEqual('foo=-72.42', qs.stringify({ foo: -72.42 })); +assert.strictEqual('foo=', qs.stringify({ foo: NaN })); +assert.strictEqual('foo=', qs.stringify({ foo: Infinity })); + // nested var f = qs.stringify({ a: 'b', |