mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
testing: Simplify some integration tests
This commit is contained in:
parent
6dedb4efc7
commit
982d9513e7
32 changed files with 93 additions and 583 deletions
|
@ -47,12 +47,7 @@ defaultContentLanguage = 'it'
|
||||||
{{ end }}
|
{{ end }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
month: _gennaio_ weekday: _lunedì_
|
month: _gennaio_ weekday: _lunedì_
|
||||||
|
|
|
@ -48,15 +48,8 @@ title = "English Title"
|
||||||
[languages.en.params.comments]
|
[languages.en.params.comments]
|
||||||
title = "English Comments Title"
|
title = "English Comments Title"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
enSite := b.H.Sites[0]
|
enSite := b.H.Sites[0]
|
||||||
b.Assert(enSite.Title(), qt.Equals, "English Title")
|
b.Assert(enSite.Title(), qt.Equals, "English Title")
|
||||||
|
@ -97,14 +90,8 @@ weight = 2
|
||||||
[languages.sv.params]
|
[languages.sv.params]
|
||||||
myparam = "svParamValue"
|
myparam = "svParamValue"
|
||||||
|
|
||||||
|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
enSite := b.H.Sites[0]
|
enSite := b.H.Sites[0]
|
||||||
svSite := b.H.Sites[1]
|
svSite := b.H.Sites[1]
|
||||||
|
@ -157,12 +144,7 @@ baseURL = "https://example.com"
|
||||||
[internal]
|
[internal]
|
||||||
running = true
|
running = true
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.Assert(b.H.Conf.Running(), qt.Equals, false)
|
b.Assert(b.H.Conf.Running(), qt.Equals, false)
|
||||||
})
|
})
|
||||||
|
@ -236,12 +218,7 @@ p1: {{ .Site.Params.p1 }}|
|
||||||
p2: {{ .Site.Params.p2 }}|
|
p2: {{ .Site.Params.p2 }}|
|
||||||
sub: {{ .Site.Params.sub }}|
|
sub: {{ .Site.Params.sub }}|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/en/index.html", `
|
b.AssertFileContent("public/en/index.html", `
|
||||||
title: English Title|
|
title: English Title|
|
||||||
|
@ -987,12 +964,7 @@ params:
|
||||||
mainSections: {{ site.Params.mainSections }}
|
mainSections: {{ site.Params.mainSections }}
|
||||||
|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
mainSections: []
|
mainSections: []
|
||||||
|
@ -1062,12 +1034,7 @@ Ein "Zitat" auf Deutsch.
|
||||||
|
|
||||||
|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", "p1: p1base", "<p>A “quote” in English.</p>")
|
b.AssertFileContent("public/index.html", "p1: p1base", "<p>A “quote” in English.</p>")
|
||||||
b.AssertFileContent("public/de/index.html", "p1: p1de", "<p>Ein «Zitat» auf Deutsch.</p>")
|
b.AssertFileContent("public/de/index.html", "p1: p1de", "<p>Ein «Zitat» auf Deutsch.</p>")
|
||||||
|
@ -1129,12 +1096,7 @@ HTACCESS.
|
||||||
|
|
||||||
|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/.htaccess", "HTACCESS")
|
b.AssertFileContent("public/.htaccess", "HTACCESS")
|
||||||
}
|
}
|
||||||
|
@ -1150,12 +1112,7 @@ LanguageCode: {{ .Site.LanguageCode }}|{{ site.Language.LanguageCode }}|
|
||||||
|
|
||||||
|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", "LanguageCode: en-US|en-US|")
|
b.AssertFileContent("public/index.html", "LanguageCode: en-US|en-US|")
|
||||||
}
|
}
|
||||||
|
@ -1181,12 +1138,7 @@ Home.
|
||||||
|
|
||||||
|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", "Home.")
|
b.AssertFileContent("public/index.html", "Home.")
|
||||||
|
|
||||||
|
@ -1214,12 +1166,7 @@ Foo: {{ site.Params.foo }}|
|
||||||
|
|
||||||
|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", "Foo: |")
|
b.AssertFileContent("public/index.html", "Foo: |")
|
||||||
})
|
})
|
||||||
|
@ -1295,12 +1242,7 @@ Home.
|
||||||
|
|
||||||
|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.Assert(b.H.Configs.Base.Module.Mounts, qt.HasLen, 7)
|
b.Assert(b.H.Configs.Base.Module.Mounts, qt.HasLen, 7)
|
||||||
b.Assert(b.H.Configs.LanguageConfigSlice[0].Module.Mounts, qt.HasLen, 7)
|
b.Assert(b.H.Configs.LanguageConfigSlice[0].Module.Mounts, qt.HasLen, 7)
|
||||||
|
@ -1321,12 +1263,7 @@ Foo.
|
||||||
-- layouts/index.html --
|
-- layouts/index.html --
|
||||||
Home.
|
Home.
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/en/index.html", "Home.")
|
b.AssertFileContent("public/en/index.html", "Home.")
|
||||||
b.AssertFileContent("public/en/foo/bar.txt", "Foo.")
|
b.AssertFileContent("public/en/foo/bar.txt", "Foo.")
|
||||||
|
@ -1354,12 +1291,7 @@ Foo.
|
||||||
-- layouts/index.html --
|
-- layouts/index.html --
|
||||||
Home.
|
Home.
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/en/index.html", "Home.")
|
b.AssertFileContent("public/en/index.html", "Home.")
|
||||||
b.AssertFileContent("public/en/foo/bar.txt", "Foo.")
|
b.AssertFileContent("public/en/foo/bar.txt", "Foo.")
|
||||||
|
@ -1387,12 +1319,7 @@ Foo.
|
||||||
-- layouts/index.html --
|
-- layouts/index.html --
|
||||||
Home.
|
Home.
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", "Home.")
|
b.AssertFileContent("public/index.html", "Home.")
|
||||||
b.AssertFileContent("public/foo/bar.txt", "Foo.")
|
b.AssertFileContent("public/foo/bar.txt", "Foo.")
|
||||||
|
@ -1417,12 +1344,7 @@ Home.
|
||||||
|
|
||||||
|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.Assert(len(b.H.Sites), qt.Equals, 1)
|
b.Assert(len(b.H.Sites), qt.Equals, 1)
|
||||||
}
|
}
|
||||||
|
@ -1557,12 +1479,7 @@ List.
|
||||||
|
|
||||||
|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileExists("public/index.html", true)
|
b.AssertFileExists("public/index.html", true)
|
||||||
b.AssertFileExists("public/categories/c1/index.html", true)
|
b.AssertFileExists("public/categories/c1/index.html", true)
|
||||||
|
|
|
@ -38,12 +38,7 @@ c = "c1"
|
||||||
-- layouts/index.html --
|
-- layouts/index.html --
|
||||||
Params: {{ site.Params}}
|
Params: {{ site.Params}}
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
Params: map[a:acp1 b:bc1 c:c1 d:dcp1]
|
Params: map[a:acp1 b:bc1 c:c1 d:dcp1]
|
||||||
|
|
|
@ -63,12 +63,7 @@ outputs: ["rss"]
|
||||||
---
|
---
|
||||||
P3. [I'm an inline-style link](https://www.example.org)
|
P3. [I'm an inline-style link](https://www.example.org)
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
P1: <p>P1. html-link: https://www.gohugo.io|</p>
|
P1: <p>P1. html-link: https://www.gohugo.io|</p>
|
||||||
|
@ -163,12 +158,7 @@ P1 Fragments: {{ .Fragments.Identifiers }}|
|
||||||
{{ .Content}}
|
{{ .Content}}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", `
|
b.AssertFileContent("public/p1/index.html", `
|
||||||
Self Fragments: [b c z]
|
Self Fragments: [b c z]
|
||||||
|
|
|
@ -18,7 +18,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestData(t *testing.T) {
|
func TestData(t *testing.T) {
|
||||||
|
|
||||||
t.Run("with theme", func(t *testing.T) {
|
t.Run("with theme", func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
@ -43,14 +42,8 @@ b: {{ site.Data.b.v1 }}|
|
||||||
cd: {{ site.Data.c.d.v1 }}|
|
cd: {{ site.Data.c.d.v1 }}|
|
||||||
d: {{ site.Data.d.v1 }}|
|
d: {{ site.Data.d.v1 }}|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", "a: a_v1|\nb: b_v1|\ncd: c_d_v1|\nd: d_v1_theme|")
|
b.AssertFileContent("public/index.html", "a: a_v1|\nb: b_v1|\ncd: c_d_v1|\nd: d_v1_theme|")
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,12 +255,7 @@ mydata.date: {{ site.Data.mydata.date }}
|
||||||
Full time: {{ $p1Date | time.Format ":time_full" }}
|
Full time: {{ $p1Date | time.Format ":time_full" }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
Future talks: 2
|
Future talks: 2
|
||||||
|
|
|
@ -76,12 +76,7 @@ Foo: {{< param foo >}}
|
||||||
-- layouts/index.html --
|
-- layouts/index.html --
|
||||||
Content: {{ .Content }}|
|
Content: {{ .Content }}|
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
<figure>
|
<figure>
|
||||||
|
@ -94,6 +89,5 @@ Foo: bar
|
||||||
|
|
||||||
|
|
||||||
`)
|
`)
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -571,12 +571,7 @@ Page IsAncestor Self: {{ $page.IsAncestor $page }}
|
||||||
Page IsDescendant Self: {{ $page.IsDescendant $page}}
|
Page IsDescendant Self: {{ $page.IsDescendant $page}}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/tests/index.html", `
|
b.AssertFileContent("public/tests/index.html", `
|
||||||
Tests|/tests/|IsMenuCurrent = true|HasMenuCurrent = false
|
Tests|/tests/|IsMenuCurrent = true|HasMenuCurrent = false
|
||||||
|
@ -609,12 +604,7 @@ Menu Item: {{ $i }}: {{ .Pre }}{{ .Name }}{{ .Post }}|{{ .URL }}|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
Menu Item: 0: <span>Home</span>|/|
|
Menu Item: 0: <span>Home</span>|/|
|
||||||
|
@ -640,12 +630,7 @@ Menu Item: {{ $i }}|{{ .URL }}|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
Menu Item: 0|/foo/posts|
|
Menu Item: 0|/foo/posts|
|
||||||
|
|
|
@ -698,12 +698,7 @@ title: "empty"
|
||||||
|{{ .RawContent }}|
|
|{{ .RawContent }}|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/basic/index.html", "|**basic**|")
|
b.AssertFileContent("public/basic/index.html", "|**basic**|")
|
||||||
b.AssertFileContent("public/empty/index.html", "! title")
|
b.AssertFileContent("public/empty/index.html", "! title")
|
||||||
|
|
|
@ -153,12 +153,7 @@ Len: {{ len $empty }}: Type: {{ printf "%T" $empty }}
|
||||||
{{ $pag := .Paginate $pgs }}
|
{{ $pag := .Paginate $pgs }}
|
||||||
Len Pag: {{ len $pag.Pages }}
|
Len Pag: {{ len $pag.Pages }}
|
||||||
`
|
`
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", "Len: 0", "Len Pag: 0")
|
b.AssertFileContent("public/index.html", "Len: 0", "Len Pag: 0")
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,12 +67,7 @@ HasShortcode not found: {{ .HasShortcode "notfound" }}|
|
||||||
Content: {{ .Content }}|
|
Content: {{ .Content }}|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html",
|
b.AssertFileContent("public/p1/index.html",
|
||||||
"Fragments: [p1-h1 p2-h1 p2-h2 p2-h3 p2-withmarkdown p3-h1 p3-h2 p3-withmarkdown]|",
|
"Fragments: [p1-h1 p2-h1 p2-h2 p2-h3 p2-withmarkdown p3-h1 p3-h2 p3-withmarkdown]|",
|
||||||
|
@ -118,12 +113,7 @@ JSON: {{ .Content }}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", "Myshort HTML")
|
b.AssertFileContent("public/p1/index.html", "Myshort HTML")
|
||||||
b.AssertFileContent("public/p1/index.json", "Myshort JSON")
|
b.AssertFileContent("public/p1/index.json", "Myshort JSON")
|
||||||
|
|
|
@ -172,12 +172,7 @@ Has other: {{ .HasShortcode "other" }}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html",
|
b.AssertFileContent("public/index.html",
|
||||||
`
|
`
|
||||||
|
@ -213,12 +208,7 @@ title: "P1"
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", `TableOfContents`)
|
b.AssertFileContent("public/p1/index.html", `TableOfContents`)
|
||||||
}
|
}
|
||||||
|
|
|
@ -916,12 +916,7 @@ title: "p1"
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", `
|
b.AssertFileContent("public/p1/index.html", `
|
||||||
<x
|
<x
|
||||||
|
@ -957,12 +952,7 @@ title: "p1"
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", "<ol>\n<li>\n<p>List 1</p>\n<ol>\n<li>Item Mark1 1</li>\n<li>Item Mark1 2</li>\n<li>Item Mark2 1</li>\n<li>Item Mark2 2\n<ol>\n<li>Item Mark2 2-1</li>\n</ol>\n</li>\n<li>Item Mark2 3</li>\n</ol>\n</li>\n</ol>")
|
b.AssertFileContent("public/p1/index.html", "<ol>\n<li>\n<p>List 1</p>\n<ol>\n<li>Item Mark1 1</li>\n<li>Item Mark1 2</li>\n<li>Item Mark2 1</li>\n<li>Item Mark2 2\n<ol>\n<li>Item Mark2 2-1</li>\n</ol>\n</li>\n<li>Item Mark2 3</li>\n</ol>\n</li>\n</ol>")
|
||||||
}
|
}
|
||||||
|
@ -987,12 +977,7 @@ echo "foo";
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", "<pre><code>echo "foo";\n</code></pre>")
|
b.AssertFileContent("public/p1/index.html", "<pre><code>echo "foo";\n</code></pre>")
|
||||||
}
|
}
|
||||||
|
@ -1023,12 +1008,7 @@ title: "p1"
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", `
|
b.AssertFileContent("public/p1/index.html", `
|
||||||
<pre><code> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">line 1<span class="p">;</span>
|
<pre><code> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">line 1<span class="p">;</span>
|
||||||
|
|
|
@ -436,12 +436,7 @@ MainSections Site method: {{ site.MainSections }}|
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
MainSections Params: [a b]|
|
MainSections Params: [a b]|
|
||||||
|
@ -469,12 +464,7 @@ MainSections Site method: {{ site.MainSections }}|
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
MainSections Params: [a b]|
|
MainSections Params: [a b]|
|
||||||
|
@ -497,12 +487,7 @@ MainSections Site method: {{ site.MainSections }}|
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
MainSections Params: [mysect]|
|
MainSections Params: [mysect]|
|
||||||
|
|
|
@ -128,12 +128,7 @@ SectionsEntries: {{ .SectionsEntries }}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/withfile/index.html", "SectionsEntries: [withfile]")
|
b.AssertFileContent("public/withfile/index.html", "SectionsEntries: [withfile]")
|
||||||
b.AssertFileContent("public/withoutfile/index.html", "SectionsEntries: [withoutfile]")
|
b.AssertFileContent("public/withoutfile/index.html", "SectionsEntries: [withoutfile]")
|
||||||
|
|
|
@ -39,12 +39,7 @@ title: doc2
|
||||||
Doc2
|
Doc2
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/sitemap.xml", " <loc>https://example.com/sect/doc1/</loc>", "doc2")
|
b.AssertFileContent("public/sitemap.xml", " <loc>https://example.com/sect/doc1/</loc>", "doc2")
|
||||||
}
|
}
|
||||||
|
@ -81,12 +76,7 @@ title: doc2
|
||||||
Doc2
|
Doc2
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/sitemap.xml", "<loc>https://example.com/en/sitemap.xml</loc>", "<loc>https://example.com/nn/sitemap.xml</loc>")
|
b.AssertFileContent("public/sitemap.xml", "<loc>https://example.com/en/sitemap.xml</loc>", "<loc>https://example.com/nn/sitemap.xml</loc>")
|
||||||
b.AssertFileContent("public/en/sitemap.xml", " <loc>https://example.com/sect/doc1/</loc>", "doc2")
|
b.AssertFileContent("public/en/sitemap.xml", " <loc>https://example.com/sect/doc1/</loc>", "doc2")
|
||||||
|
@ -109,12 +99,7 @@ outputs: [ "html", "amp" ]
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
// Should link to the HTML version.
|
// Should link to the HTML version.
|
||||||
b.AssertFileContent("public/sitemap.xml", " <loc>https://example.com/blog/html-amp/</loc>")
|
b.AssertFileContent("public/sitemap.xml", " <loc>https://example.com/blog/html-amp/</loc>")
|
||||||
|
|
|
@ -730,12 +730,7 @@ tags_weight: 40
|
||||||
---
|
---
|
||||||
`
|
`
|
||||||
|
|
||||||
b := NewIntegrationTestBuilder(
|
b := Test(t, files)
|
||||||
IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `:/p1/|/p3/|/p2/|:`)
|
b.AssertFileContent("public/index.html", `:/p1/|/p3/|/p2/|:`)
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,12 +44,7 @@ l1: {{ i18n "l1" }}|l2: {{ i18n "l2" }}|l3: {{ i18n "l3" }}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
l1: l1main|l2: l2main|l3: l3theme
|
l1: l1main|l2: l2main|l3: l3theme
|
||||||
|
@ -92,12 +87,7 @@ i18n: {{ i18n "a" . }}|
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
i18n: Reading time: 3|
|
i18n: Reading time: 3|
|
||||||
|
@ -131,12 +121,7 @@ title: home_es
|
||||||
---
|
---
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/es/index.html", `home_es_gato`)
|
b.AssertFileContent("public/es/index.html", `home_es_gato`)
|
||||||
b.AssertFileContent("public/fr/index.html", `home_fr_gato`)
|
b.AssertFileContent("public/fr/index.html", `home_fr_gato`)
|
||||||
|
|
|
@ -87,13 +87,7 @@ echo "l8";
|
||||||
§§§
|
§§§
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", `
|
b.AssertFileContent("public/p1/index.html", `
|
||||||
Goat SVG:<svg class='diagram'
|
Goat SVG:<svg class='diagram'
|
||||||
|
@ -152,13 +146,7 @@ fmt.Println("Hello, World!");
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html",
|
b.AssertFileContent("public/p1/index.html",
|
||||||
"Inner: |<span class=\"line\"><span class=\"cl\"><span class=\"nx\">fmt</span><span class=\"p\">.</span><span class=\"nf\">Println</span><span class=\"p\">(</span><span class=\"s\">"Hello, World!"</span><span class=\"p\">);</span></span></span>|",
|
"Inner: |<span class=\"line\"><span class=\"cl\"><span class=\"nx\">fmt</span><span class=\"p\">.</span><span class=\"nf\">Println</span><span class=\"p\">(</span><span class=\"s\">"Hello, World!"</span><span class=\"p\">);</span></span></span>|",
|
||||||
|
@ -188,13 +176,7 @@ title: "p1"
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", `
|
b.AssertFileContent("public/p1/index.html", `
|
||||||
# Issue 9627: For the Position in code blocks we try to match the .Inner with the original source. This isn't always possible.
|
# Issue 9627: For the Position in code blocks we try to match the .Inner with the original source. This isn't always possible.
|
||||||
|
@ -223,13 +205,7 @@ echo "p1";
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", "|echo \"p1\";|")
|
b.AssertFileContent("public/p1/index.html", "|echo \"p1\";|")
|
||||||
}
|
}
|
||||||
|
@ -257,12 +233,7 @@ Position: {{ .Position | safeHTML }}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", filepath.FromSlash("Position: \"/content/p1.md:7:1\""))
|
b.AssertFileContent("public/p1/index.html", filepath.FromSlash("Position: \"/content/p1.md:7:1\""))
|
||||||
}
|
}
|
||||||
|
@ -290,12 +261,7 @@ Hello, World!
|
||||||
Attributes: {{ .Attributes }}|Type: {{ .Type }}|
|
Attributes: {{ .Attributes }}|Type: {{ .Type }}|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", "<h2 id=\"issue-10118\">Issue 10118</h2>\nAttributes: map[foo:bar]|Type: |")
|
b.AssertFileContent("public/p1/index.html", "<h2 id=\"issue-10118\">Issue 10118</h2>\nAttributes: map[foo:bar]|Type: |")
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,13 +50,7 @@ foo
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", `
|
b.AssertFileContent("public/p1/index.html", `
|
||||||
<h2 class="a" id="heading">
|
<h2 class="a" id="heading">
|
||||||
|
@ -85,13 +79,7 @@ title: "p1"
|
||||||
>{{ .Text | safeHTML }}</h{{ .Level }}>
|
>{{ .Text | safeHTML }}</h{{ .Level }}>
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", `
|
b.AssertFileContent("public/p1/index.html", `
|
||||||
<h2 data-foo="bar" id="heading">Heading</h2>
|
<h2 data-foo="bar" id="heading">Heading</h2>
|
||||||
|
@ -111,13 +99,7 @@ title: "p1"
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", `
|
b.AssertFileContent("public/p1/index.html", `
|
||||||
class="a < b"
|
class="a < b"
|
||||||
|
@ -141,13 +123,7 @@ safeHTML: |{{- range $k, $v := .Attributes -}}{{ $k }}: {{ $v | safeHTML }}|{{ e
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", `
|
b.AssertFileContent("public/p1/index.html", `
|
||||||
plain: |class: Smith & Wesson|id: heading-attribute-which-needs-escaping|
|
plain: |class: Smith & Wesson|id: heading-attribute-which-needs-escaping|
|
||||||
|
@ -178,13 +154,7 @@ title: "p1"
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html",
|
b.AssertFileContent("public/p1/index.html",
|
||||||
"<h2 id=\"hello-testhttpsexamplecom\">\n Hello <a href=\"https://example.com\">Test</a>\n\n <a class=\"anchor\" href=\"#hello-testhttpsexamplecom\">#</a>\n</h2>",
|
"<h2 id=\"hello-testhttpsexamplecom\">\n Hello <a href=\"https://example.com\">Test</a>\n\n <a class=\"anchor\" href=\"#hello-testhttpsexamplecom\">#</a>\n</h2>",
|
||||||
|
@ -252,12 +222,7 @@ LINE8
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html",
|
b.AssertFileContent("public/p1/index.html",
|
||||||
"<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">LINE1\n</span></span></code></pre></div>",
|
"<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">LINE1\n</span></span></code></pre></div>",
|
||||||
|
@ -397,7 +362,6 @@ FENCE
|
||||||
|
|
||||||
runBenchmark(files, b)
|
runBenchmark(files, b)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iisse #8959
|
// Iisse #8959
|
||||||
|
@ -406,7 +370,6 @@ func TestHookInfiniteRecursion(t *testing.T) {
|
||||||
|
|
||||||
for _, renderFunc := range []string{"markdownify", ".Page.RenderString"} {
|
for _, renderFunc := range []string{"markdownify", ".Page.RenderString"} {
|
||||||
t.Run(renderFunc, func(t *testing.T) {
|
t.Run(renderFunc, func(t *testing.T) {
|
||||||
|
|
||||||
files := `
|
files := `
|
||||||
-- config.toml --
|
-- config.toml --
|
||||||
-- layouts/_default/_markup/render-link.html --
|
-- layouts/_default/_markup/render-link.html --
|
||||||
|
@ -436,11 +399,8 @@ a@b.com
|
||||||
|
|
||||||
b.Assert(err, qt.IsNotNil)
|
b.Assert(err, qt.IsNotNil)
|
||||||
b.Assert(err.Error(), qt.Contains, "text is already rendered, repeating it may cause infinite recursion")
|
b.Assert(err.Error(), qt.Contains, "text is already rendered, repeating it may cause infinite recursion")
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Issue 9594
|
// Issue 9594
|
||||||
|
@ -460,12 +420,7 @@ title: "p1"
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", `
|
b.AssertFileContent("public/p1/index.html", `
|
||||||
<img src="b.jpg" alt=""a"">
|
<img src="b.jpg" alt=""a"">
|
||||||
|
@ -476,7 +431,6 @@ func TestLinkifyProtocol(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
runTest := func(protocol string, withHook bool) *hugolib.IntegrationTestBuilder {
|
runTest := func(protocol string, withHook bool) *hugolib.IntegrationTestBuilder {
|
||||||
|
|
||||||
files := `
|
files := `
|
||||||
-- config.toml --
|
-- config.toml --
|
||||||
[markup.goldmark]
|
[markup.goldmark]
|
||||||
|
@ -507,7 +461,6 @@ Link https procol: https://www.example.org
|
||||||
TxtarString: files,
|
TxtarString: files,
|
||||||
},
|
},
|
||||||
).Build()
|
).Build()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, withHook := range []bool{false, true} {
|
for _, withHook := range []bool{false, true} {
|
||||||
|
@ -564,12 +517,7 @@ a <!-- b --> c
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContentExact("public/p1/index.html",
|
b.AssertFileContentExact("public/p1/index.html",
|
||||||
// Issue 9650
|
// Issue 9650
|
||||||
|
@ -621,12 +569,7 @@ sc3_begin|{{ .Inner }}|sc3_end
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContentExact("public/p1/index.html",
|
b.AssertFileContentExact("public/p1/index.html",
|
||||||
// Issue #7332
|
// Issue #7332
|
||||||
|
@ -657,12 +600,7 @@ title: "p1"
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContentExact("public/p1/index.html", "<p>:x:</p>")
|
b.AssertFileContentExact("public/p1/index.html", "<p>:x:</p>")
|
||||||
}
|
}
|
||||||
|
@ -680,12 +618,7 @@ title: "p1"
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContentExact("public/p1/index.html", "<p>:x:</p>")
|
b.AssertFileContentExact("public/p1/index.html", "<p>:x:</p>")
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,13 +45,7 @@ This is an inline image: ![Inline Image](/inline.jpg). Some more text.
|
||||||
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}|{{ .Ordinal }}" />
|
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}|{{ .Ordinal }}" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
`
|
`
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html",
|
b.AssertFileContent("public/p1/index.html",
|
||||||
"This is an inline image: \n\t<img src=\"/inline.jpg\" alt=\"Inline Image|0\" />\n. Some more text.</p>",
|
"This is an inline image: \n\t<img src=\"/inline.jpg\" alt=\"Inline Image|0\" />\n. Some more text.</p>",
|
||||||
|
@ -70,13 +64,7 @@ This is an inline image: ![Inline Image](/inline.jpg). Some more text.
|
||||||
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" />
|
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
`
|
`
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html",
|
b.AssertFileContent("public/p1/index.html",
|
||||||
"This is an inline image: \n\t<img src=\"/inline.jpg\" alt=\"Inline Image\" />\n. Some more text.</p>",
|
"This is an inline image: \n\t<img src=\"/inline.jpg\" alt=\"Inline Image\" />\n. Some more text.</p>",
|
||||||
|
@ -86,26 +74,14 @@ This is an inline image: ![Inline Image](/inline.jpg). Some more text.
|
||||||
|
|
||||||
t.Run("No Hook, no wrap", func(t *testing.T) {
|
t.Run("No Hook, no wrap", func(t *testing.T) {
|
||||||
files := strings.ReplaceAll(filesTemplate, "CONFIG_VALUE", "false")
|
files := strings.ReplaceAll(filesTemplate, "CONFIG_VALUE", "false")
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", "<p>This is an inline image: <img src=\"/inline.jpg\" alt=\"Inline Image\">. Some more text.</p>\n<img src=\"/block.jpg\" alt=\"Block Image\" class=\"b\">")
|
b.AssertFileContent("public/p1/index.html", "<p>This is an inline image: <img src=\"/inline.jpg\" alt=\"Inline Image\">. Some more text.</p>\n<img src=\"/block.jpg\" alt=\"Block Image\" class=\"b\">")
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("No Hook, wrap", func(t *testing.T) {
|
t.Run("No Hook, wrap", func(t *testing.T) {
|
||||||
files := strings.ReplaceAll(filesTemplate, "CONFIG_VALUE", "true")
|
files := strings.ReplaceAll(filesTemplate, "CONFIG_VALUE", "true")
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", "<p class=\"b\"><img src=\"/block.jpg\" alt=\"Block Image\"></p>")
|
b.AssertFileContent("public/p1/index.html", "<p class=\"b\"><img src=\"/block.jpg\" alt=\"Block Image\"></p>")
|
||||||
})
|
})
|
||||||
|
|
|
@ -67,13 +67,7 @@ HighlightCodeBlock: Wrapped:{{ $result.Wrapped }}|Inner:{{ $result.Inner }}
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html",
|
b.AssertFileContent("public/p1/index.html",
|
||||||
"Inline:<code class=\"code-inline language-emacs\"><span class=\"p\">(</span><span class=\"nf\">message</span> <span class=\"s\">"this highlight shortcode"</span><span class=\"p\">)</span></code>:End.",
|
"Inline:<code class=\"code-inline language-emacs\"><span class=\"p\">(</span><span class=\"nf\">message</span> <span class=\"s\">"this highlight shortcode"</span><span class=\"p\">)</span></code>:End.",
|
||||||
|
@ -103,13 +97,7 @@ xəx := 0
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
NeedsOsFS: false,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
<span class="nx">xəx</span>
|
<span class="nx">xəx</span>
|
||||||
|
|
|
@ -114,11 +114,7 @@ Content: {{ .Content }}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
}).Build()
|
|
||||||
|
|
||||||
expect := `
|
expect := `
|
||||||
P1 Fragments: [p1-title]
|
P1 Fragments: [p1-title]
|
||||||
|
|
|
@ -20,7 +20,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGroupByLocalizedDate(t *testing.T) {
|
func TestGroupByLocalizedDate(t *testing.T) {
|
||||||
|
|
||||||
files := `
|
files := `
|
||||||
-- config.toml --
|
-- config.toml --
|
||||||
defaultContentLanguage = 'en'
|
defaultContentLanguage = 'en'
|
||||||
|
@ -72,7 +71,6 @@ date: "2020-02-01"
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPagesSortCollation(t *testing.T) {
|
func TestPagesSortCollation(t *testing.T) {
|
||||||
|
|
||||||
files := `
|
files := `
|
||||||
-- config.toml --
|
-- config.toml --
|
||||||
defaultContentLanguage = 'en'
|
defaultContentLanguage = 'en'
|
||||||
|
@ -166,12 +164,7 @@ RelPermalink: {{ .RelPermalink }}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
}).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/a/c/d/index.html", "RelPermalink: /a/c/d/")
|
b.AssertFileContent("public/a/c/d/index.html", "RelPermalink: /a/c/d/")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,11 +59,7 @@ LangURL: {{ relLangURL "foo" }}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
}).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/en/index.html", `
|
b.AssertFileContent("public/en/index.html", `
|
||||||
Hello1: Hello
|
Hello1: Hello
|
||||||
|
|
|
@ -156,11 +156,7 @@ resize 2|RelPermalink: {{ $image.RelPermalink }}|MediaType: {{ $image.MediaType
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
}).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html",
|
b.AssertFileContent("public/index.html",
|
||||||
"jpg|RelPermalink: /images/pixel_hu8aa3346827e49d756ff4e630147c42b5_70_filter_17010532266664966692.jpg|MediaType: image/jpeg|Width: 1|Height: 1|",
|
"jpg|RelPermalink: /images/pixel_hu8aa3346827e49d756ff4e630147c42b5_70_filter_17010532266664966692.jpg|MediaType: image/jpeg|Width: 1|Height: 1|",
|
||||||
|
|
|
@ -32,12 +32,7 @@ baseURL = 'http://example.com/'
|
||||||
{{ return "foo"}}
|
{{ return "foo"}}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
[foo foo foo]
|
[foo foo foo]
|
||||||
|
@ -89,12 +84,7 @@ func TestAppendSliceToASliceOfSlices(t *testing.T) {
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", "[[a] [b] [c]]")
|
b.AssertFileContent("public/index.html", "[[a] [b] [c]]")
|
||||||
}
|
}
|
||||||
|
@ -113,12 +103,7 @@ func TestAppendNilToSlice(t *testing.T) {
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", "[a <nil>]")
|
b.AssertFileContent("public/index.html", "[a <nil>]")
|
||||||
}
|
}
|
||||||
|
@ -180,12 +165,7 @@ title: "p3"
|
||||||
{{< lorem 60 >}}
|
{{< lorem 60 >}}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
Home: p1|p3|
|
Home: p1|p3|
|
||||||
|
@ -218,12 +198,7 @@ foo: bc
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</ul>
|
</ul>
|
||||||
`
|
`
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
b.AssertFileContent("public/index.html", "<ul><li>P1</li><li>P2</li></ul>")
|
b.AssertFileContent("public/index.html", "<ul><li>P1</li><li>P2</li></ul>")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,12 +221,7 @@ boolf = false
|
||||||
{{ echoParam .Site.Params.footer "boolf" }}
|
{{ echoParam .Site.Params.footer "boolf" }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
b.AssertFileContent("public/index.html",
|
b.AssertFileContent("public/index.html",
|
||||||
"foo",
|
"foo",
|
||||||
"42",
|
"42",
|
||||||
|
|
|
@ -40,12 +40,7 @@ imageConfig2 OK: {{ (imageConfig $path2).Width }}|
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
fileExists OK: true|
|
fileExists OK: true|
|
||||||
|
|
|
@ -196,12 +196,7 @@ title: "P1"
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/p1/index.html", "<nav id=\"TableOfContents\"></nav> \n<h1 id=\"heading-1\">Heading 1</h1>")
|
b.AssertFileContent("public/p1/index.html", "<nav id=\"TableOfContents\"></nav> \n<h1 id=\"heading-1\">Heading 1</h1>")
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,12 +39,7 @@ partial: {{ partials.Include "foo.html" . }}
|
||||||
foo
|
foo
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
partial: foo
|
partial: foo
|
||||||
|
@ -64,12 +59,7 @@ partialCached: {{ partials.IncludeCached "foo.html" . }}
|
||||||
foo
|
foo
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
partialCached: foo
|
partialCached: foo
|
||||||
|
@ -93,12 +83,7 @@ P2
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
P2
|
P2
|
||||||
|
@ -130,12 +115,7 @@ P2
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
SHORT
|
SHORT
|
||||||
|
@ -180,12 +160,7 @@ D1
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
// fmt.Println(b.FileContent("public/index.html"))
|
// fmt.Println(b.FileContent("public/index.html"))
|
||||||
|
|
||||||
|
@ -340,12 +315,7 @@ FOO:{{ $r.Content }}
|
||||||
BAR
|
BAR
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", "OO:BAR")
|
b.AssertFileContent("public/index.html", "OO:BAR")
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,11 +54,7 @@ Copy3: {{ $copy3.RelPermalink}}|{{ $copy3.MediaType }}|{{ $copy3.Content | safeJ
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
}).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
Image Orig: /blog/images/pixel.png|image/png|1|1|
|
Image Orig: /blog/images/pixel.png|image/png|1|1|
|
||||||
|
@ -112,11 +108,7 @@ iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAA
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
}).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
Image OK
|
Image OK
|
||||||
|
|
|
@ -34,12 +34,7 @@ partials/doesnotexist.html: {{ templates.Exists "partials/doesnotexist.html" }}
|
||||||
-- layouts/partials/foo.html --
|
-- layouts/partials/foo.html --
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
index.html: true
|
index.html: true
|
||||||
|
@ -69,12 +64,7 @@ post/doesnotexist.html: {{ templates.Exists "post/doesnotexist.html" }}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
index.html: true
|
index.html: true
|
||||||
|
@ -96,12 +86,7 @@ Home: {{ page.IsHome }}
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.Test(t, files)
|
||||||
hugolib.IntegrationTestConfig{
|
|
||||||
T: t,
|
|
||||||
TxtarString: files,
|
|
||||||
},
|
|
||||||
).Build()
|
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
Home: true
|
Home: true
|
||||||
|
|
Loading…
Reference in a new issue