Skip to content

Commit 3073fd5

Browse files
committed
testing: Replace legacy config.toml with hugo.toml in most tests
1 parent b9b304a commit 3073fd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+158
-116
lines changed

‎common/htime/htime_integration_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestApplyWithContext(t *testing.T) {
2424
t.Parallel()
2525

2626
files := `
27-
-- config.toml --
27+
-- hugo.toml --
2828
defaultContentLanguage = 'it'
2929
-- layouts/home.html --
3030
{{ $dates := slice

‎hugolib/config_legacy1_test.go‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright 2025 The Hugo Authors. All rights reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
14+
package hugolib
15+
16+
import (
17+
"strings"
18+
"testing"
19+
)
20+
21+
func TestLegacyConfigDotToml(t *testing.T) {
22+
const filesTemplate = `
23+
-- config.toml --
24+
title = "My Site"
25+
-- layouts/home.html --
26+
Site: {{ .Site.Title }}
27+
28+
`
29+
t.Run("In root", func(t *testing.T) {
30+
t.Parallel()
31+
files := filesTemplate
32+
b := Test(t, files)
33+
b.AssertFileContent("public/index.html", "Site: My Site")
34+
})
35+
36+
t.Run("In config dir", func(t *testing.T) {
37+
t.Parallel()
38+
files := strings.Replace(filesTemplate, "-- config.toml --", "-- config/_default/config.toml --", 1)
39+
b := Test(t, files)
40+
b.AssertFileContent("public/index.html", "Site: My Site")
41+
})
42+
}

‎hugolib/config_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025-present The Hugo Authors. All rights reserved.
1+
// Copyright 2025 The Hugo Authors. All rights reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -640,7 +640,7 @@ func TestInvalidDefaultMarkdownHandler(t *testing.T) {
640640
t.Parallel()
641641

642642
files := `
643-
-- config.toml --
643+
-- hugo.toml --
644644
[markup]
645645
defaultMarkdownHandler = 'blackfriday'
646646
-- content/_index.md --

‎hugolib/content_map_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func TestIntegrationTestTemplate(t *testing.T) {
202202
c := qt.New(t)
203203

204204
files := `
205-
-- config.toml --
205+
-- hugo.toml --
206206
title = "Integration Test"
207207
disableKinds=["page", "section", "taxonomy", "term", "sitemap", "robotsTXT", "RSS"]
208208
-- layouts/home.html --

‎hugolib/dates_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func TestTOMLDates(t *testing.T) {
205205
t.Parallel()
206206

207207
files := `
208-
-- config.toml --
208+
-- hugo.toml --
209209
timeZone = "America/Los_Angeles"
210210
-- content/_index.md --
211211
---

‎hugolib/hugo_modules_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func TestMountsProject(t *testing.T) {
229229
t.Parallel()
230230

231231
files := `
232-
-- config.toml --
232+
-- hugo.toml --
233233
baseURL="https://example.org"
234234
235235
[module]

‎hugolib/hugo_smoke_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ func benchmarkBaselineFiles(leafBundles bool) string {
782782
rnd := rand.New(rand.NewSource(32))
783783

784784
files := `
785-
-- config.toml --
785+
-- hugo.toml --
786786
baseURL = "https://example.com"
787787
defaultContentLanguage = 'en'
788788

‎hugolib/hugolib_integration_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestPageTranslationsMap(t *testing.T) {
2525
t.Parallel()
2626

2727
files := `
28-
-- config.toml --
28+
-- hugo.toml --
2929
baseURL = 'https://example.org/'
3030
title = 'Issue-9073'
3131
defaultContentLanguageInSubdir = true
@@ -118,7 +118,7 @@ func TestTitleCaseStyleWithAutomaticSectionPages(t *testing.T) {
118118
t.Parallel()
119119

120120
files := `
121-
-- config.toml --
121+
-- hugo.toml --
122122
titleCaseStyle = 'none'
123123
-- content/books/book-1.md --
124124
---

‎hugolib/language_content_dir_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func TestContentMountMerge(t *testing.T) {
6161
t.Parallel()
6262

6363
files := `
64-
-- config.toml --
64+
-- hugo.toml --
6565
baseURL = 'https://example.org/'
6666
languageCode = 'en-us'
6767
title = 'Hugo Forum Topic #37225'

‎hugolib/menu_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ func TestMenuHasMenuCurrentSection(t *testing.T) {
423423
t.Parallel()
424424

425425
files := `
426-
-- config.toml --
426+
-- hugo.toml --
427427
disableKinds = ['RSS','sitemap','taxonomy','term']
428428
[[menu.main]]
429429
name = 'Home'

0 commit comments

Comments
 (0)