This commit is contained in:
Leo Horie 2016-10-18 18:07:01 -04:00
parent 6514a38162
commit e798bd34ae
2 changed files with 6 additions and 1 deletions

View file

@ -34,6 +34,11 @@ o.spec("buildQueryString", function() {
o(string).equals("a%5B0%5D=x&a%5B1%5D=y")
})
o("handles array w/ dupe values", function() {
var string = buildQueryString({a: ["x", "x"]})
o(string).equals("a%5B0%5D=x&a%5B1%5D=x")
})
o("handles deep nested array", function() {
var string = buildQueryString({a: [["x", "y"]]})

View file

@ -74,7 +74,7 @@ o.spec("parseQueryString", function() {
})
o("does not cast numbers", function() {
var data = parseQueryString("a=1&b=-2.3&c=0x10&d=1e2&e=Infinity")
o(data).deepEquals({a: "1", b: "-2.3", c: "16", d: "1e2", e: "Infinity"})
o(data).deepEquals({a: "1", b: "-2.3", c: "0x10", d: "1e2", e: "Infinity"})
})
o("does not cast NaN", function() {
var data = parseQueryString("a=NaN")