Skip to content
Permalink
Browse files

hugolib: Add a site benchmark

  • Loading branch information...
bep committed Aug 16, 2019
1 parent f28efd3 commit 416493b548a9bbaa27758fba9bab50a22b680e9d
Showing with 9,730 additions and 0 deletions.
  1. +28 −0 hugolib/site_benchmark_new_test.go
  2. +9,702 −0 hugolib/testdata/what-is-markdown.md
@@ -15,6 +15,7 @@ package hugolib

import (
"fmt"
"io/ioutil"
"path"
"path/filepath"
"strconv"
@@ -117,6 +118,33 @@ Some content.
s.AssertFileContent("public/tags/ta3/index.html", "|ta3|")
},
},
{"Markdown", func(b testing.TB) *sitesBuilder {
sb := newTestSitesBuilder(b).WithConfigFile("toml", `
title = "What is Markdown"
baseURL = "https://example.com"
`)
data, err := ioutil.ReadFile(filepath.FromSlash("testdata/what-is-markdown.md"))
sb.Assert(err, qt.IsNil)
datastr := string(data)
getContent := func(i int) string {
return fmt.Sprintf(`---
title: "Page %d"
---
`, i) + datastr

}
for i := 1; i <= 100; i++ {
sb.WithContent(fmt.Sprintf("content/page%d.md", i), getContent(i))
}

return sb
},
func(s *sitesBuilder) {
s.Assert(s.CheckExists("public/page8/index.html"), qt.Equals, true)
},
},
{"Canonify URLs", func(b testing.TB) *sitesBuilder {
sb := newTestSitesBuilder(b).WithConfigFile("toml", `
title = "Canon"

0 comments on commit 416493b

Please sign in to comment.
You can’t perform that action at this time.