From 0bdc0d62d4f5d117032e4c09f2438e9df4a9c18b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 21 Jul 2016 15:30:12 +0200 Subject: [PATCH] Add shortcode null param variant See #2294 --- hugolib/shortcode_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 55a8a22fe..b30b5b511 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -124,6 +124,13 @@ func TestPositionalParamIndexOutOfBounds(t *testing.T) { CheckShortCodeMatch(t, "{{< video 47238zzb >}}", "Playing Video error: index out of range for positional param at position 1", tem) } +// Issue #2294 +func TestPositionalParamNil(t *testing.T) { + tem := tpl.New() + tem.AddInternalShortcode("div.html", `
{{ .Inner }}
`) + CheckShortCodeMatch(t, "{{% div %}}**foo**{{% /div %}}", "
foo
", tem) +} + // some repro issues for panics in Go Fuzz testing func TestShortcodeGoFuzzRepros(t *testing.T) { tt := tpl.New()