Add "missing slice" to the Params test

See #2249
This commit is contained in:
Bjørn Erik Pedersen 2016-07-21 21:03:44 +02:00
parent 593a546fc6
commit 39a452a4c7

View file

@ -149,9 +149,11 @@ func TestNestedNamedMissingParam(t *testing.T) {
tem := tpl.New()
tem.AddInternalShortcode("acc.html", `<div class="acc">{{ .Inner }}</div>`)
tem.AddInternalShortcode("div.html", `<div {{with .Get "class"}} class="{{ . }}"{{ end }}>{{ .Inner }}</div>`)
tem.AddInternalShortcode("div2.html", `<div {{with .Get 0}} class="{{ . }}"{{ end }}>{{ .Inner }}</div>`)
CheckShortCodeMatch(t,
`{{% acc %}}{{% div %}}{{% /div %}}{{% /acc %}}`,
"<div class=\"acc\"><div ></div>\n</div>", tem)
`{{% acc %}}{{% div %}}d1{{% /div %}}{{% div2 %}}d2{{% /div2 %}}{{% /acc %}}`,
"<div class=\"acc1\"><div></div>\n</div>", tem)
}
func TestIsNamedParamsSC(t *testing.T) {