mirror of
https://github.com/google/go-jsonnet.git
synced 2025-09-28 17:01:02 +02:00
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>
This commit is contained in:
parent
5d0f3fb5ed
commit
9bba8deca0
5
testdata/builtinManifestJsonEx.golden
vendored
5
testdata/builtinManifestJsonEx.golden
vendored
@ -1 +1,4 @@
|
||||
"{\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}"
|
||||
{
|
||||
"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}",
|
||||
"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]"
|
||||
}
|
||||
|
60
testdata/builtinManifestJsonEx.jsonnet
vendored
60
testdata/builtinManifestJsonEx.jsonnet
vendored
@ -1,22 +1,46 @@
|
||||
local a = {
|
||||
foo: "bar",
|
||||
bar: self.foo,
|
||||
baz: 1,
|
||||
bazel: 1.42,
|
||||
boom: -1,
|
||||
bim: false,
|
||||
bam: true,
|
||||
blamo: {
|
||||
cereal: [
|
||||
"<>& fizbuzz",
|
||||
],
|
||||
foo: 'bar',
|
||||
bar: self.foo,
|
||||
baz: 1,
|
||||
bazel: 1.42,
|
||||
boom: -1,
|
||||
bim: false,
|
||||
bam: true,
|
||||
blamo: {
|
||||
cereal: [
|
||||
'<>& fizbuzz',
|
||||
],
|
||||
|
||||
treats: [
|
||||
{
|
||||
name: "chocolate",
|
||||
}
|
||||
],
|
||||
}
|
||||
treats: [
|
||||
{
|
||||
name: 'chocolate',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
std.manifestJsonEx(a, " ")
|
||||
local b = [
|
||||
'bar',
|
||||
a.foo,
|
||||
1,
|
||||
1.42,
|
||||
-1,
|
||||
false,
|
||||
true,
|
||||
{
|
||||
cereal: [
|
||||
'<>& fizbuzz',
|
||||
],
|
||||
|
||||
treats: [
|
||||
{
|
||||
name: 'chocolate',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
{
|
||||
a: std.manifestJsonEx(a, ' '),
|
||||
b: std.manifestJsonEx(b, ' '),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user