Skip to content

Commit 7fc3768

Browse files
cdleonarddmaccormack
authored andcommitted
test: Reproduce issue #556
Signed-off-by: Leonard Crestez <cdleonard@gmail.com>
1 parent 5afc7fd commit 7fc3768

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/issue556.test.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { JsonURL } from "../src/JsonURL.js";
2+
3+
test("aqf implied array e empty", function () {
4+
expect(JsonURL.parse("e,!e", { AQF: true, impliedArray: [] })).toStrictEqual(
5+
["e", ""])
6+
})
7+
test("aqf implied array empty e", function () {
8+
expect(JsonURL.parse("!e,e", { AQF: true, impliedArray: [] })).toStrictEqual(["", "e"]);
9+
})
10+
test("aqf explicit array e empty", function () {
11+
expect(JsonURL.parse("(e,!e)", { AQF: true })).toStrictEqual(
12+
["e", ""]);
13+
})
14+
15+
test("aqf implied dict e:empty", function () {
16+
expect(JsonURL.parse("e:!e", { AQF: true, impliedObject: {} })).toStrictEqual(
17+
{ "e": "" });
18+
})
19+
test("aqf explicit dict e:empty", function () {
20+
expect(JsonURL.parse("(e:!e)", { AQF: true })).toStrictEqual(
21+
{ "e": "" });
22+
})
23+
test("aqf implied dict empty:e", function () {
24+
expect(JsonURL.parse("!e:e", { AQF: true, impliedObject: {} })).toStrictEqual(
25+
{ "": "e" })
26+
})
27+
test("aqf implied dict e:empty a:b", function () {
28+
expect(JsonURL.parse("e:!e,a:b", { AQF: true, impliedObject: {} })).toStrictEqual(
29+
{ "e": "", "a": "b" });
30+
})

0 commit comments

Comments
 (0)