summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo_sites_build_failures_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/hugo_sites_build_failures_test.go')
-rw-r--r--hugolib/hugo_sites_build_failures_test.go42
1 files changed, 42 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_build_failures_test.go b/hugolib/hugo_sites_build_failures_test.go
new file mode 100644
index 000000000..b347490cd
--- /dev/null
+++ b/hugolib/hugo_sites_build_failures_test.go
@@ -0,0 +1,42 @@
+package hugolib
+
+import (
+ "fmt"
+ "testing"
+)
+
+// https://github.com/gohugoio/hugo/issues/4526
+func TestSiteBuildFailureInvalidPageMetadata(t *testing.T) {
+ t.Parallel()
+
+ validContentFile := `
+---
+title = "This is good"
+---
+
+Some content.
+`
+
+ invalidContentFile := `
+---
+title = "PDF EPUB: Anne Bradstreet: Poems "The Prologue Summary And Analysis EBook Full Text "
+---
+
+Some content.
+`
+
+ var contentFiles []string
+ for i := 0; i <= 30; i++ {
+ name := fmt.Sprintf("valid%d.md", i)
+ contentFiles = append(contentFiles, name, validContentFile)
+ if i%5 == 0 {
+ name = fmt.Sprintf("invalid%d.md", i)
+ contentFiles = append(contentFiles, name, invalidContentFile)
+ }
+ }
+
+ b := newTestSitesBuilder(t)
+ b.WithSimpleConfigFile().WithContent(contentFiles...)
+ b.CreateSites().BuildFail(BuildCfg{})
+
+}