summaryrefslogtreecommitdiffstats
path: root/tpl/collections/integration_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/collections/integration_test.go')
-rw-r--r--tpl/collections/integration_test.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/tpl/collections/integration_test.go b/tpl/collections/integration_test.go
index 225eab9fa..da1d6e488 100644
--- a/tpl/collections/integration_test.go
+++ b/tpl/collections/integration_test.go
@@ -73,3 +73,34 @@ Desc: [map[a:3 b:3] map[a:3 b:1] map[a:3 b:1] map[a:3 b:1] map[a:3 b:0] map[a:3
}
}
+
+// Issue #11004.
+func TestAppendSliceToASliceOfSlices(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+-- layouts/index.html --
+{{ $obj := slice (slice "a") }}
+{{ $obj = $obj | append (slice "b") }}
+{{ $obj = $obj | append (slice "c") }}
+
+{{ $obj }}
+
+
+ `
+
+ for i := 0; i < 4; i++ {
+
+ b := hugolib.NewIntegrationTestBuilder(
+ hugolib.IntegrationTestConfig{
+ T: t,
+ TxtarString: files,
+ },
+ ).Build()
+
+ b.AssertFileContent("public/index.html", "[[a] [b] [c]]")
+
+ }
+
+}