mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-10 21:31:30 +00:00
Update missing positional parameter test for .Get
This commit is contained in:
parent
236f0c840b
commit
e2b277bba5
1 changed files with 2 additions and 2 deletions
|
@ -144,10 +144,10 @@ func TestPositionalParamSC(t *testing.T) {
|
||||||
func TestPositionalParamIndexOutOfBounds(t *testing.T) {
|
func TestPositionalParamIndexOutOfBounds(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
wt := func(tem tpl.TemplateHandler) error {
|
wt := func(tem tpl.TemplateHandler) error {
|
||||||
tem.AddTemplate("_internal/shortcodes/video.html", `Playing Video {{ .Get 1 }}`)
|
tem.AddTemplate("_internal/shortcodes/video.html", `Playing Video {{ with .Get 1 }}{{ . }}{{ else }}Missing{{ end }}`)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
CheckShortCodeMatch(t, "{{< video 47238zzb >}}", "Playing Video error: index out of range for positional param at position 1", wt)
|
CheckShortCodeMatch(t, "{{< video 47238zzb >}}", "Playing Video Missing", wt)
|
||||||
}
|
}
|
||||||
|
|
||||||
// some repro issues for panics in Go Fuzz testing
|
// some repro issues for panics in Go Fuzz testing
|
||||||
|
|
Loading…
Reference in a new issue