ref: 39a452a4c7bc4705af455d1dd2a77c6cd56bf96d
parent: 593a546fc6b00d4a34eba3b3f5172fed2c100507
author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
date: Thu Jul 21 17:03:44 EDT 2016
Add "missing slice" to the Params test See #2249
--- a/hugolib/shortcode_test.go
+++ b/hugolib/shortcode_test.go
@@ -149,9 +149,11 @@
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) {
--
⑨