From 4da672af888cbd0db79463bf456b5210ad9a463d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 13 Jul 2023 15:01:41 +0200 Subject: Return error when .Render is invoked without arg Fixes #11243 --- hugolib/page_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'hugolib/page_test.go') diff --git a/hugolib/page_test.go b/hugolib/page_test.go index 162f26052..5237b6340 100644 --- a/hugolib/page_test.go +++ b/hugolib/page_test.go @@ -1983,3 +1983,25 @@ title: "p2" b.Assert(identity.HashString(p1), qt.Not(qt.Equals), identity.HashString(p2)) b.Assert(identity.HashString(sites[0]), qt.Not(qt.Equals), identity.HashString(sites[1])) } + +// Issue #11243 +func TestRenderWithoutArgument(t *testing.T) { + t.Parallel() + + files := ` +-- hugo.toml -- +-- layouts/index.html -- +{{ .Render }} +` + + b, err := NewIntegrationTestBuilder( + IntegrationTestConfig{ + T: t, + TxtarString: files, + Running: true, + }, + ).BuildE() + + b.Assert(err, qt.IsNotNil) + +} -- cgit v1.2.3