mirror of
https://github.com/google/go-jsonnet.git
synced 2025-09-28 17:01:02 +02:00
testdata: std.manifestJsonEx text cases more types
This commit adds test cases for more types to ensure that std.manifestJsonEx continues to work with all types that may be given as the `value` parameter. Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
This commit is contained in:
parent
9bba8deca0
commit
9b6cbef4ca
8
testdata/builtinManifestJsonEx.golden
vendored
8
testdata/builtinManifestJsonEx.golden
vendored
@ -1,4 +1,8 @@
|
||||
{
|
||||
"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]"
|
||||
"array": "[\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]",
|
||||
"bool": "true",
|
||||
"null": "null",
|
||||
"number": "42",
|
||||
"object": "{\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}",
|
||||
"string": "\"foo\""
|
||||
}
|
||||
|
14
testdata/builtinManifestJsonEx.jsonnet
vendored
14
testdata/builtinManifestJsonEx.jsonnet
vendored
@ -1,4 +1,4 @@
|
||||
local a = {
|
||||
local object = {
|
||||
foo: 'bar',
|
||||
bar: self.foo,
|
||||
baz: 1,
|
||||
@ -19,9 +19,9 @@ local a = {
|
||||
},
|
||||
};
|
||||
|
||||
local b = [
|
||||
local array = [
|
||||
'bar',
|
||||
a.foo,
|
||||
object.foo,
|
||||
1,
|
||||
1.42,
|
||||
-1,
|
||||
@ -41,6 +41,10 @@ local b = [
|
||||
];
|
||||
|
||||
{
|
||||
a: std.manifestJsonEx(a, ' '),
|
||||
b: std.manifestJsonEx(b, ' '),
|
||||
array: std.manifestJsonEx(array, ' '),
|
||||
bool: std.manifestJsonEx(true, ' '),
|
||||
'null': std.manifestJsonEx(null, ' '),
|
||||
object: std.manifestJsonEx(object, ' '),
|
||||
number: std.manifestJsonEx(42, ' '),
|
||||
string: std.manifestJsonEx('foo', ' '),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user