aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/page_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2022-03-17 22:03:27 +0100
committerBjørn Erik Pedersen <[email protected]>2022-03-17 22:03:27 +0100
commitb80853de90b10171155b8f3fde47d64ec7bfa0dd (patch)
tree435d3dbf7a495a0c6ce64c9769e037179aa0d27b /hugolib/page_test.go
parent423594e03a906ef4150f433666ff588b022c3c92 (diff)
downloadhugo-b80853de90b10171155b8f3fde47d64ec7bfa0dd.tar.gz
hugo-b80853de90b10171155b8f3fde47d64ec7bfa0dd.zip
all: gofmt -w -r 'interface{} -> any' .
Updates #9687
Diffstat (limited to 'hugolib/page_test.go')
-rw-r--r--hugolib/page_test.go30
1 files changed, 15 insertions, 15 deletions
diff --git a/hugolib/page_test.go b/hugolib/page_test.go
index 926fdb354..d29a4f865 100644
--- a/hugolib/page_test.go
+++ b/hugolib/page_test.go
@@ -298,7 +298,7 @@ func checkPageTitle(t *testing.T, page page.Page, title string) {
}
}
-func checkPageContent(t *testing.T, page page.Page, expected string, msg ...interface{}) {
+func checkPageContent(t *testing.T, page page.Page, expected string, msg ...any) {
t.Helper()
a := normalizeContent(expected)
b := normalizeContent(content(page))
@@ -325,7 +325,7 @@ func checkPageTOC(t *testing.T, page page.Page, toc string) {
}
}
-func checkPageSummary(t *testing.T, page page.Page, summary string, msg ...interface{}) {
+func checkPageSummary(t *testing.T, page page.Page, summary string, msg ...any) {
a := normalizeContent(string(page.Summary()))
b := normalizeContent(summary)
if a != b {
@@ -369,7 +369,7 @@ func normalizeExpected(ext, str string) string {
}
func testAllMarkdownEnginesForPages(t *testing.T,
- assertFunc func(t *testing.T, ext string, pages page.Pages), settings map[string]interface{}, pageSources ...string) {
+ assertFunc func(t *testing.T, ext string, pages page.Pages), settings map[string]any, pageSources ...string) {
engines := []struct {
ext string
@@ -399,8 +399,8 @@ func testAllMarkdownEnginesForPages(t *testing.T,
contentDir = s
}
- cfg.Set("security", map[string]interface{}{
- "exec": map[string]interface{}{
+ cfg.Set("security", map[string]any{
+ "exec": map[string]any{
"allow": []string{"^python$", "^rst2html.*", "^asciidoctor$"},
},
})
@@ -572,7 +572,7 @@ func TestCreateNewPage(t *testing.T) {
checkPageType(t, p, "page")
}
- settings := map[string]interface{}{
+ settings := map[string]any{
"contentDir": "mycontent",
}
@@ -697,7 +697,7 @@ func TestPageWithShortCodeInSummary(t *testing.T) {
func TestPageWithAdditionalExtension(t *testing.T) {
t.Parallel()
cfg, fs := newTestCfg()
- cfg.Set("markup", map[string]interface{}{
+ cfg.Set("markup", map[string]any{
"defaultMarkdownHandler": "blackfriday", // TODO(bep)
})
@@ -1039,18 +1039,18 @@ func TestPageWithLastmodFromGitInfo(t *testing.T) {
wd, err := os.Getwd()
c.Assert(err, qt.IsNil)
- cfg.Set("frontmatter", map[string]interface{}{
+ cfg.Set("frontmatter", map[string]any{
"lastmod": []string{":git", "lastmod"},
})
cfg.Set("defaultContentLanguage", "en")
- langConfig := map[string]interface{}{
- "en": map[string]interface{}{
+ langConfig := map[string]any{
+ "en": map[string]any{
"weight": 1,
"languageName": "English",
"contentDir": "content",
},
- "nn": map[string]interface{}{
+ "nn": map[string]any{
"weight": 2,
"languageName": "Nynorsk",
"contentDir": "content_nn",
@@ -1102,7 +1102,7 @@ lastMod: 2018-02-28
Content
`
- cfg.Set("frontmatter", map[string]interface{}{
+ cfg.Set("frontmatter", map[string]any{
"date": []string{dateHandler, "date"},
})
@@ -1163,7 +1163,7 @@ func TestWordCountWithAllCJKRunesWithoutHasCJKLanguage(t *testing.T) {
func TestWordCountWithAllCJKRunesHasCJKLanguage(t *testing.T) {
t.Parallel()
- settings := map[string]interface{}{"hasCJKLanguage": true}
+ settings := map[string]any{"hasCJKLanguage": true}
assertFunc := func(t *testing.T, ext string, pages page.Pages) {
p := pages[0]
@@ -1176,7 +1176,7 @@ func TestWordCountWithAllCJKRunesHasCJKLanguage(t *testing.T) {
func TestWordCountWithMainEnglishWithCJKRunes(t *testing.T) {
t.Parallel()
- settings := map[string]interface{}{"hasCJKLanguage": true}
+ settings := map[string]any{"hasCJKLanguage": true}
assertFunc := func(t *testing.T, ext string, pages page.Pages) {
p := pages[0]
@@ -1195,7 +1195,7 @@ func TestWordCountWithMainEnglishWithCJKRunes(t *testing.T) {
func TestWordCountWithIsCJKLanguageFalse(t *testing.T) {
t.Parallel()
- settings := map[string]interface{}{
+ settings := map[string]any{
"hasCJKLanguage": true,
}