go-jsonnet/testdata/builtinManifestJsonEx.jsonnet
Lucas Servén Marín 9b6cbef4ca 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>
2021-02-15 14:44:08 +01:00

51 lines
695 B
Jsonnet

local object = {
foo: 'bar',
bar: self.foo,
baz: 1,
bazel: 1.42,
boom: -1,
bim: false,
bam: true,
blamo: {
cereal: [
'<>& fizbuzz',
],
treats: [
{
name: 'chocolate',
},
],
},
};
local array = [
'bar',
object.foo,
1,
1.42,
-1,
false,
true,
{
cereal: [
'<>& fizbuzz',
],
treats: [
{
name: 'chocolate',
},
],
},
];
{
array: std.manifestJsonEx(array, ' '),
bool: std.manifestJsonEx(true, ' '),
'null': std.manifestJsonEx(null, ' '),
object: std.manifestJsonEx(object, ' '),
number: std.manifestJsonEx(42, ' '),
string: std.manifestJsonEx('foo', ' '),
}