mirror of
https://github.com/google/go-jsonnet.git
synced 2026-05-05 12:06:11 +02:00
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>
51 lines
695 B
Jsonnet
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', ' '),
|
|
}
|