mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
tpl/partials: Fix partialCached deadlock regression
This is a rollback of 0927cf739f
We cannot do that change until we either completes #9570 or possibly also use the new TryLock in GO 1.18.
Fixes #9588
Opens #4086
This commit is contained in:
@@ -103,6 +103,44 @@ P2
|
||||
`)
|
||||
}
|
||||
|
||||
// Issue #588
|
||||
func TestIncludeCachedRecursionShortcode(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- config.toml --
|
||||
baseURL = 'http://example.com/'
|
||||
-- content/_index.md --
|
||||
---
|
||||
title: "Index"
|
||||
---
|
||||
{{< short >}}
|
||||
-- layouts/index.html --
|
||||
{{ partials.IncludeCached "p1.html" . }}
|
||||
-- layouts/partials/p1.html --
|
||||
{{ .Content }}
|
||||
{{ partials.IncludeCached "p2.html" . }}
|
||||
-- layouts/partials/p2.html --
|
||||
-- layouts/shortcodes/short.html --
|
||||
SHORT
|
||||
{{ partials.IncludeCached "p2.html" . }}
|
||||
P2
|
||||
|
||||
`
|
||||
|
||||
b := hugolib.NewIntegrationTestBuilder(
|
||||
hugolib.IntegrationTestConfig{
|
||||
T: t,
|
||||
TxtarString: files,
|
||||
},
|
||||
).Build()
|
||||
|
||||
b.AssertFileContent("public/index.html", `
|
||||
SHORT
|
||||
P2
|
||||
`)
|
||||
}
|
||||
|
||||
func TestIncludeCacheHints(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
Reference in New Issue
Block a user