mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Add a test helper
This commit is contained in:
@@ -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 {
|
||||||
|
Reference in New Issue
Block a user