mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Add a test helper
This commit is contained in:
parent
833d16d467
commit
c34bf48560
1 changed files with 10 additions and 0 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
@ -980,6 +981,15 @@ func content(c resource.ContentProvider) string {
|
||||||
return ccs
|
return ccs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func pagesToString(pages ...page.Page) string {
|
||||||
|
var paths []string
|
||||||
|
for _, p := range pages {
|
||||||
|
paths = append(paths, p.Path())
|
||||||
|
}
|
||||||
|
sort.Strings(paths)
|
||||||
|
return strings.Join(paths, "|")
|
||||||
|
}
|
||||||
|
|
||||||
func dumpPages(pages ...page.Page) {
|
func dumpPages(pages ...page.Page) {
|
||||||
fmt.Println("---------")
|
fmt.Println("---------")
|
||||||
for _, p := range pages {
|
for _, p := range pages {
|
||||||
|
|
Loading…
Reference in a new issue