@ -162,8 +162,8 @@ keyInElement1 = "valueInElement1"`,
tpl string
tpl string
expect any
expect any
vars any
vars any
<< << << < HEAD
} {
} { {
{
tpl : ` {{ mustToYaml . }} ` ,
tpl : ` {{ mustToYaml . }} ` ,
vars : loopMap ,
vars : loopMap ,
} , {
} , {
@ -207,42 +207,6 @@ keyInElement1 = "valueInElement1"`,
expect : "foo = \"bar\"\n" , // should succeed and return TOML string
expect : "foo = \"bar\"\n" , // should succeed and return TOML string
vars : map [ string ] string { "foo" : "bar" } ,
vars : map [ string ] string { "foo" : "bar" } ,
} ,
} ,
== == == =
} {
{
tpl : ` {{ mustToYaml . }} ` ,
vars : loopMap ,
} , {
tpl : ` {{ mustToJson . }} ` ,
vars : loopMap ,
} , {
tpl : ` {{ mustToDuration 30 }} ` ,
expect : ` 30s ` ,
vars : nil ,
} , {
tpl : ` {{ mustToDuration "1m30s" }} ` ,
expect : ` 1m30s ` ,
vars : nil ,
} , {
tpl : ` {{ mustToDuration "foo" }} ` ,
vars : nil ,
} , {
tpl : ` {{ toYaml . }} ` ,
expect : "" , // should return empty string and swallow error
vars : loopMap ,
} , {
tpl : ` {{ toJson . }} ` ,
expect : "" , // should return empty string and swallow error
vars : loopMap ,
} , {
tpl : ` {{ mustToToml . }} ` ,
vars : map [ int ] string { 1 : "one" } , // non-string key is invalid in TOML
} , {
tpl : ` {{ mustToToml . }} ` ,
expect : "foo = \"bar\"\n" , // should succeed and return TOML string
vars : map [ string ] string { "foo" : "bar" } ,
} ,
>> >> >> > f3d68cdbea3076a0283cbd1e3ec44a409ad48a43
}
}
for _ , tt := range mustFuncsTests {
for _ , tt := range mustFuncsTests {