Skip to content

Commit 0a41545

Browse files
committed
testdata: add manifestJsonEx array test case
This commit adds a test case to prevent regressions in std.manifestJsonEx accepting arrays as values. Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
1 parent edd3797 commit 0a41545

File tree

2 files changed

+46
-19
lines changed

2 files changed

+46
-19
lines changed

testdata/builtinManifestJsonEx.golden

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
"{\n \"bam\": true,\n \"bar\": \"bar\",\n \"baz\": 1,\n \"bazel\": 1.42,\n \"bim\": false,\n \"blamo\": {\n \"cereal\": [\n \"<>& fizbuzz\"\n ],\n \"treats\": [\n {\n \"name\": \"chocolate\"\n }\n ]\n },\n \"boom\": -1,\n \"foo\": \"bar\"\n}"
1+
{
2+
"a": "{\n \"bam\": true,\n \"bar\": \"bar\",\n \"baz\": 1,\n \"bazel\": 1.42,\n \"bim\": false,\n \"blamo\": {\n \"cereal\": [\n \"<>& fizbuzz\"\n ],\n \"treats\": [\n {\n \"name\": \"chocolate\"\n }\n ]\n },\n \"boom\": -1,\n \"foo\": \"bar\"\n}",
3+
"b": "[\n \"bar\",\n \"bar\",\n 1,\n 1.42,\n -1,\n false,\n true,\n {\n \"cereal\": [\n \"<>& fizbuzz\"\n ],\n \"treats\": [\n {\n \"name\": \"chocolate\"\n }\n ]\n }\n]"
4+
}
Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,46 @@
11
local a = {
2-
foo: "bar",
3-
bar: self.foo,
4-
baz: 1,
5-
bazel: 1.42,
6-
boom: -1,
7-
bim: false,
8-
bam: true,
9-
blamo: {
10-
cereal: [
11-
"<>& fizbuzz",
12-
],
2+
foo: 'bar',
3+
bar: self.foo,
4+
baz: 1,
5+
bazel: 1.42,
6+
boom: -1,
7+
bim: false,
8+
bam: true,
9+
blamo: {
10+
cereal: [
11+
'<>& fizbuzz',
12+
],
1313

14-
treats: [
15-
{
16-
name: "chocolate",
17-
}
18-
],
19-
}
14+
treats: [
15+
{
16+
name: 'chocolate',
17+
},
18+
],
19+
},
2020
};
2121

22-
std.manifestJsonEx(a, " ")
22+
local b = [
23+
'bar',
24+
a.foo,
25+
1,
26+
1.42,
27+
-1,
28+
false,
29+
true,
30+
{
31+
cereal: [
32+
'<>& fizbuzz',
33+
],
34+
35+
treats: [
36+
{
37+
name: 'chocolate',
38+
},
39+
],
40+
},
41+
];
42+
43+
{
44+
a: std.manifestJsonEx(a, ' '),
45+
b: std.manifestJsonEx(b, ' '),
46+
}

0 commit comments

Comments
 (0)