]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
testing: Simplify some integration tests
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 28 Jan 2024 21:11:05 +0000 (22:11 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 28 Jan 2024 21:17:22 +0000 (22:17 +0100)
32 files changed:
common/htime/htime_integration_test.go
hugolib/config_test.go
hugolib/configdir_test.go
hugolib/content_render_hooks_test.go
hugolib/datafiles_test.go
hugolib/dates_test.go
hugolib/embedded_shortcodes_test.go
hugolib/menu_test.go
hugolib/page_test.go
hugolib/paginator_test.go
hugolib/rendershortcodes_test.go
hugolib/renderstring_test.go
hugolib/shortcode_test.go
hugolib/site_test.go
hugolib/site_url_test.go
hugolib/sitemap_test.go
hugolib/taxonomy_test.go
langs/i18n/i18n_integration_test.go
markup/goldmark/codeblocks/codeblocks_integration_test.go
markup/goldmark/goldmark_integration_test.go
markup/goldmark/images/images_integration_test.go
markup/highlight/highlight_integration_test.go
related/related_integration_test.go
resources/page/page_integration_test.go
resources/resource_transformers/templates/templates_integration_test.go
resources/resources_integration_test.go
tpl/collections/collections_integration_test.go
tpl/images/images_integration_test.go
tpl/page/page_integration_test.go
tpl/partials/partials_integration_test.go
tpl/resources/resources_integration_test.go
tpl/templates/templates_integration_test.go

index 983fff1f77f82726ea076395b891873d7a112bbe..8090add12c31a97a5f13d0142bfdaa4a46d25ed4 100644 (file)
@@ -47,12 +47,7 @@ defaultContentLanguage = 'it'
 {{ end }}
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 month: _gennaio_ weekday: _lunedì_
index 2cc3255fe67dd89d55992f9d2e8fc81a89af64c2..14a23a03dff7312a3c31c30fe42c4c950179eab5 100644 (file)
@@ -48,15 +48,8 @@ title = "English Title"
 [languages.en.params.comments]
 title = "English Comments Title"
 
-
-
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        enSite := b.H.Sites[0]
        b.Assert(enSite.Title(), qt.Equals, "English Title")
@@ -97,14 +90,8 @@ weight = 2
 [languages.sv.params]
 myparam = "svParamValue"
 
-
 `
-               b := NewIntegrationTestBuilder(
-                       IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                       },
-               ).Build()
+               b := Test(t, files)
 
                enSite := b.H.Sites[0]
                svSite := b.H.Sites[1]
@@ -157,12 +144,7 @@ baseURL = "https://example.com"
 [internal]
 running = true
 `
-               b := NewIntegrationTestBuilder(
-                       IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                       },
-               ).Build()
+               b := Test(t, files)
 
                b.Assert(b.H.Conf.Running(), qt.Equals, false)
        })
@@ -236,12 +218,7 @@ p1: {{ .Site.Params.p1 }}|
 p2: {{ .Site.Params.p2 }}|
 sub: {{ .Site.Params.sub }}|
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/en/index.html", `
 title: English Title|
@@ -987,12 +964,7 @@ params:
 mainSections: {{ site.Params.mainSections }}
 
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 mainSections: []
@@ -1062,12 +1034,7 @@ Ein "Zitat" auf Deutsch.
 
 
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/index.html", "p1: p1base", "<p>A &ldquo;quote&rdquo; in English.</p>")
        b.AssertFileContent("public/de/index.html", "p1: p1de", "<p>Ein &laquo;Zitat&raquo; auf Deutsch.</p>")
@@ -1129,12 +1096,7 @@ HTACCESS.
 
        
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/.htaccess", "HTACCESS")
 }
@@ -1150,12 +1112,7 @@ LanguageCode: {{ .Site.LanguageCode }}|{{ site.Language.LanguageCode }}|
 
        
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/index.html", "LanguageCode: en-US|en-US|")
 }
@@ -1181,12 +1138,7 @@ Home.
 
        
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/index.html", "Home.")
 
@@ -1214,12 +1166,7 @@ Foo: {{ site.Params.foo }}|
        
                
        `
-               b := NewIntegrationTestBuilder(
-                       IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                       },
-               ).Build()
+               b := Test(t, files)
 
                b.AssertFileContent("public/index.html", "Foo: |")
        })
@@ -1295,12 +1242,7 @@ Home.
 
        
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.Assert(b.H.Configs.Base.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 --
 Home.
 `
-               b := NewIntegrationTestBuilder(
-                       IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                       },
-               ).Build()
+               b := Test(t, files)
 
                b.AssertFileContent("public/en/index.html", "Home.")
                b.AssertFileContent("public/en/foo/bar.txt", "Foo.")
@@ -1354,12 +1291,7 @@ Foo.
 -- layouts/index.html --
 Home.
 `
-               b := NewIntegrationTestBuilder(
-                       IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                       },
-               ).Build()
+               b := Test(t, files)
 
                b.AssertFileContent("public/en/index.html", "Home.")
                b.AssertFileContent("public/en/foo/bar.txt", "Foo.")
@@ -1387,12 +1319,7 @@ Foo.
 -- layouts/index.html --
 Home.
 `
-               b := NewIntegrationTestBuilder(
-                       IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                       },
-               ).Build()
+               b := Test(t, files)
 
                b.AssertFileContent("public/index.html", "Home.")
                b.AssertFileContent("public/foo/bar.txt", "Foo.")
@@ -1417,12 +1344,7 @@ Home.
 
        
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.Assert(len(b.H.Sites), qt.Equals, 1)
 }
@@ -1557,12 +1479,7 @@ List.
 
 
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileExists("public/index.html", true)
        b.AssertFileExists("public/categories/c1/index.html", true)
index 032cb4e2651f993efe6d5c1006d85eec00c68710..39505563d8222ca642d7af376cbb562fddfc43b6 100644 (file)
@@ -38,12 +38,7 @@ c = "c1"
 -- layouts/index.html --
 Params: {{ site.Params}}
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 Params: map[a:acp1 b:bc1 c:c1 d:dcp1]
index 22a33c35ae62a5d93bbc3261cc59b5e944a5f10a..93b0e1621afdc9a8a2dc55a7f221022179c06797 100644 (file)
@@ -63,12 +63,7 @@ outputs: ["rss"]
 ---
 P3. [I'm an inline-style link](https://www.example.org)
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 P1: <p>P1. html-link: https://www.gohugo.io|</p>
@@ -163,12 +158,7 @@ P1 Fragments: {{ .Fragments.Identifiers }}|
 {{ .Content}}
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", `
 Self Fragments: [b c z]
index 73586c31c69ea0e416eb7afa01d8dbd401b6539a..48447414a21fa5648ee6b66fb24dac9c76e1d27c 100644 (file)
@@ -18,7 +18,6 @@ import (
 )
 
 func TestData(t *testing.T) {
-
        t.Run("with theme", func(t *testing.T) {
                t.Parallel()
 
@@ -43,14 +42,8 @@ b: {{  site.Data.b.v1 }}|
 cd: {{ site.Data.c.d.v1 }}|
 d: {{  site.Data.d.v1 }}|
 `
-               b := NewIntegrationTestBuilder(
-                       IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                       },
-               ).Build()
+               b := Test(t, files)
 
                b.AssertFileContent("public/index.html", "a: a_v1|\nb: b_v1|\ncd: c_d_v1|\nd: d_v1_theme|")
-
        })
 }
index 376fe3c6067d82b98be91728663ac948c690b385..5443e58521d9b0f4ce80f36f5584f92d4990d3e1 100644 (file)
@@ -255,12 +255,7 @@ mydata.date: {{ site.Data.mydata.date }}
 Full time: {{ $p1Date | time.Format ":time_full" }}
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 Future talks: 2
index 6436f29a10ee3883be1932cfb768b12c077a775c..5188be2c9608c69fa30b32a20c127a5fd815f638 100644 (file)
@@ -76,12 +76,7 @@ Foo: {{< param foo >}}
 -- layouts/index.html --
 Content: {{ .Content }}|
 `
-               b := NewIntegrationTestBuilder(
-                       IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                       },
-               ).Build()
+               b := Test(t, files)
 
                b.AssertFileContent("public/index.html", `
 <figure>
@@ -94,6 +89,5 @@ Foo: bar
 
 
 `)
-
        })
 }
index 77d92d04f6514880d8b653aec86a00d4679719f6..8ff74304b0d8d6d1deeef8895daf67ec9857cd97 100644 (file)
@@ -571,12 +571,7 @@ Page IsAncestor Self: {{ $page.IsAncestor $page }}
 Page IsDescendant Self: {{ $page.IsDescendant $page}}
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/tests/index.html", `
 Tests|/tests/|IsMenuCurrent = true|HasMenuCurrent = false
@@ -609,12 +604,7 @@ Menu Item: {{ $i }}: {{ .Pre }}{{ .Name }}{{ .Post }}|{{ .URL }}|
 {{ end }}
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 Menu Item: 0: <span>Home</span>|/|     
@@ -640,12 +630,7 @@ Menu Item: {{ $i }}|{{ .URL }}|
 {{ end }}
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 Menu Item: 0|/foo/posts|
index f5ff95f3c29edf21c6fa5240662d41d1e22c467c..e003f2ee1168ad304bb0fcd587ef4788653ac5dd 100644 (file)
@@ -698,12 +698,7 @@ title: "empty"
 |{{ .RawContent }}|
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/basic/index.html", "|**basic**|")
        b.AssertFileContent("public/empty/index.html", "! title")
index fd2321413fc41f4df15751f883261f35e82a44a0..98b67bca5137ed2c6a2ba005d2afe3e4d93b7331 100644 (file)
@@ -153,12 +153,7 @@ Len: {{ len $empty }}: Type: {{ printf "%T" $empty }}
 {{ $pag := .Paginate $pgs }}
 Len Pag: {{ len $pag.Pages }}
 `
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/index.html", "Len: 0", "Len Pag: 0")
 }
index d0bc0546c412f254a7f70eda88ab4df89b4354c8..696ed8f416c3388fc34a88ced15965b5a94ec8db 100644 (file)
@@ -67,12 +67,7 @@ HasShortcode not found: {{ .HasShortcode "notfound" }}|
 Content: {{ .Content }}|
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/p1/index.html",
                "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(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", "Myshort HTML")
        b.AssertFileContent("public/p1/index.json", "Myshort JSON")
index 40980bdcb4cc313b1c554af7e60f1a7cac39033d..413943698204b7fca61af218dd58d7203a1f56b0 100644 (file)
@@ -172,12 +172,7 @@ Has other: {{ .HasShortcode "other" }}
 
        `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/index.html",
                `
@@ -213,12 +208,7 @@ title: "P1"
 {{ .Content }}
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", `TableOfContents`)
 }
index 656364021db7471204ebf1d590acd5445b96a1c7..a1c5c0aea2a01b5144532a23445137f9ab716f72 100644 (file)
@@ -916,12 +916,7 @@ title: "p1"
 {{ .Content }}
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", `
 <x
@@ -957,12 +952,7 @@ title: "p1"
 {{ .Content }}
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        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 }}
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", "<pre><code>echo &quot;foo&quot;;\n</code></pre>")
 }
@@ -1023,12 +1008,7 @@ title: "p1"
 {{ .Content }}
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        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>
index cf0d4a032a8b8346bf0973c0b3a5254a839d9655..967fb827dd1518cce32a90fa822be3b1819f7bf8 100644 (file)
@@ -436,12 +436,7 @@ MainSections Site method: {{ site.MainSections }}|
        
        `
 
-               b := NewIntegrationTestBuilder(
-                       IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                       },
-               ).Build()
+               b := Test(t, files)
 
                b.AssertFileContent("public/index.html", `
 MainSections Params: [a b]|
@@ -469,12 +464,7 @@ MainSections Site method: {{ site.MainSections }}|
 
 `
 
-               b := NewIntegrationTestBuilder(
-                       IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                       },
-               ).Build()
+               b := Test(t, files)
 
                b.AssertFileContent("public/index.html", `
 MainSections Params: [a b]|
@@ -497,12 +487,7 @@ MainSections Site method: {{ site.MainSections }}|
        
        `
 
-               b := NewIntegrationTestBuilder(
-                       IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                       },
-               ).Build()
+               b := Test(t, files)
 
                b.AssertFileContent("public/index.html", `
 MainSections Params: [mysect]|
index 2cc5328546afa93e212d0849812a206a7463f165..8efaae3a24f0225b1621a37f71d448cb9275c06e 100644 (file)
@@ -128,12 +128,7 @@ SectionsEntries: {{ .SectionsEntries }}
 
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/withfile/index.html", "SectionsEntries: [withfile]")
        b.AssertFileContent("public/withoutfile/index.html", "SectionsEntries: [withoutfile]")
index be13ba1f4bb601d376369e9b3141e5d380b85cf9..6c2cbc5573a8e64e75bdd1cba32dea8427c3fd6e 100644 (file)
@@ -39,12 +39,7 @@ title: doc2
 Doc2
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/sitemap.xml", " <loc>https://example.com/sect/doc1/</loc>", "doc2")
 }
@@ -81,12 +76,7 @@ title: doc2
 Doc2
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        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")
@@ -109,12 +99,7 @@ outputs: [ "html", "amp" ]
 
 `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        // Should link to the HTML version.
        b.AssertFileContent("public/sitemap.xml", " <loc>https://example.com/blog/html-amp/</loc>")
index 3132cc4852023dd41829053f86376f15acdb776d..0db3e9c3910c5ed6db80c9eed50e0eb730f234bc 100644 (file)
@@ -730,12 +730,7 @@ tags_weight: 40
 ---
        `
 
-       b := NewIntegrationTestBuilder(
-               IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := Test(t, files)
 
        b.AssertFileContent("public/index.html", `:/p1/|/p3/|/p2/|:`)
 }
index 7deae645199cdcc05dc493561848784e669ab41f..b62a2900e25bc4d914e71714a569ad40a45bff39 100644 (file)
@@ -44,12 +44,7 @@ l1: {{ i18n "l1"  }}|l2: {{ i18n "l2"  }}|l3: {{ i18n "l3"  }}
 
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 l1: l1main|l2: l2main|l3: l3theme
@@ -92,12 +87,7 @@ i18n: {{ i18n "a" . }}|
 
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
        i18n: Reading time: 3|
@@ -131,12 +121,7 @@ title: home_es
 ---
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/es/index.html", `home_es_gato`)
        b.AssertFileContent("public/fr/index.html", `home_fr_gato`)
index 5597fc507c76583f4294c7efac6593e3e876eac2..8ed691302d636cf3111497622a5255b45b7209ec 100644 (file)
@@ -87,13 +87,7 @@ echo "l8";
 §§§
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-                       NeedsOsFS:   false,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", `
 Goat SVG:<svg class='diagram'
@@ -152,13 +146,7 @@ fmt.Println("Hello, World!");
 
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-                       NeedsOsFS:   false,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        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\">&#34;Hello, World!&#34;</span><span class=\"p\">);</span></span></span>|",
@@ -188,13 +176,7 @@ title: "p1"
 
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-                       NeedsOsFS:   false,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        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.
@@ -223,13 +205,7 @@ echo "p1";
 
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-                       NeedsOsFS:   false,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", "|echo \"p1\";|")
 }
@@ -257,12 +233,7 @@ Position: {{ .Position | safeHTML }}
 
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", filepath.FromSlash("Position: \"/content/p1.md:7:1\""))
 }
@@ -290,12 +261,7 @@ Hello, World!
 Attributes: {{ .Attributes }}|Type: {{ .Type }}|
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", "<h2 id=\"issue-10118\">Issue 10118</h2>\nAttributes: map[foo:bar]|Type: |")
 }
index c9c6ef3386423222dd0fb61ed142fdffd2470a88..ffeb763a7f1eb8d8b57cb4a661c8a6932966617e 100644 (file)
@@ -50,13 +50,7 @@ foo
 {{ .Content }}
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-                       NeedsOsFS:   false,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", `
                <h2 class="a" id="heading">
@@ -85,13 +79,7 @@ title: "p1"
 >{{ .Text | safeHTML }}</h{{ .Level }}>
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-                       NeedsOsFS:   false,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", `
                <h2 data-foo="bar" id="heading">Heading</h2>
@@ -111,13 +99,7 @@ title: "p1"
 {{ .Content }}
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-                       NeedsOsFS:   false,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", `
 class="a &lt; b"
@@ -141,13 +123,7 @@ safeHTML: |{{- range $k, $v := .Attributes -}}{{ $k }}: {{ $v | safeHTML }}|{{ e
 {{ .Content }}
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-                       NeedsOsFS:   false,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", `
 plain: |class: Smith &amp; Wesson|id: heading-attribute-which-needs-escaping|
@@ -178,13 +154,7 @@ title: "p1"
 
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-                       NeedsOsFS:   false,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        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>",
@@ -252,12 +222,7 @@ LINE8
 
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        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>",
@@ -397,7 +362,6 @@ FENCE
 
                runBenchmark(files, b)
        })
-
 }
 
 // Iisse #8959
@@ -406,7 +370,6 @@ func TestHookInfiniteRecursion(t *testing.T) {
 
        for _, renderFunc := range []string{"markdownify", ".Page.RenderString"} {
                t.Run(renderFunc, func(t *testing.T) {
-
                        files := `
 -- config.toml --
 -- layouts/_default/_markup/render-link.html --
@@ -436,11 +399,8 @@ a@b.com
 
                        b.Assert(err, qt.IsNotNil)
                        b.Assert(err.Error(), qt.Contains, "text is already rendered, repeating it may cause infinite recursion")
-
                })
-
        }
-
 }
 
 // Issue 9594
@@ -460,12 +420,7 @@ title: "p1"
 {{ .Content }}
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", `
                <img src="b.jpg" alt="&quot;a&quot;">
@@ -476,7 +431,6 @@ func TestLinkifyProtocol(t *testing.T) {
        t.Parallel()
 
        runTest := func(protocol string, withHook bool) *hugolib.IntegrationTestBuilder {
-
                files := `
 -- config.toml --
 [markup.goldmark]
@@ -507,7 +461,6 @@ Link https procol: https://www.example.org
                                TxtarString: files,
                        },
                ).Build()
-
        }
 
        for _, withHook := range []bool{false, true} {
@@ -564,12 +517,7 @@ a <!-- b --> c
 {{ .Content }}
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContentExact("public/p1/index.html",
                // Issue 9650
@@ -621,12 +569,7 @@ sc3_begin|{{ .Inner }}|sc3_end
 {{ .Content }}
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContentExact("public/p1/index.html",
                // Issue #7332
@@ -657,12 +600,7 @@ title: "p1"
 {{ .Content }}
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContentExact("public/p1/index.html", "<p>:x:</p>")
 }
@@ -680,12 +618,7 @@ title: "p1"
 {{ .Content }}
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContentExact("public/p1/index.html", "<p>:x:</p>")
 }
index 8b0ba99c144e16196cc5fe2955abdf225524aefe..387287e7ac3395fc7794dc1b935f28012f713156 100644 (file)
@@ -45,13 +45,7 @@ This is an inline image: ![Inline Image](/inline.jpg). Some more text.
        <img src="{{ .Destination | safeURL }}" alt="{{ .Text }}|{{ .Ordinal }}" />
 {{ end }}
 `
-               b := hugolib.NewIntegrationTestBuilder(
-                       hugolib.IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                               NeedsOsFS:   false,
-                       },
-               ).Build()
+               b := hugolib.Test(t, files)
 
                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>",
@@ -70,13 +64,7 @@ This is an inline image: ![Inline Image](/inline.jpg). Some more text.
        <img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" />
 {{ end }}
 `
-               b := hugolib.NewIntegrationTestBuilder(
-                       hugolib.IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                               NeedsOsFS:   false,
-                       },
-               ).Build()
+               b := hugolib.Test(t, files)
 
                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>",
@@ -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) {
                files := strings.ReplaceAll(filesTemplate, "CONFIG_VALUE", "false")
-               b := hugolib.NewIntegrationTestBuilder(
-                       hugolib.IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                               NeedsOsFS:   false,
-                       },
-               ).Build()
+               b := hugolib.Test(t, files)
 
                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) {
                files := strings.ReplaceAll(filesTemplate, "CONFIG_VALUE", "true")
-               b := hugolib.NewIntegrationTestBuilder(
-                       hugolib.IntegrationTestConfig{
-                               T:           t,
-                               TxtarString: files,
-                               NeedsOsFS:   false,
-                       },
-               ).Build()
+               b := hugolib.Test(t, files)
 
                b.AssertFileContent("public/p1/index.html", "<p class=\"b\"><img src=\"/block.jpg\" alt=\"Block Image\"></p>")
        })
index b53b585c0a35be0ca32d6509a36032b6a251c8a4..d36bc820a7b259f34bb99b655474d62da76cbc02 100644 (file)
@@ -67,13 +67,7 @@ HighlightCodeBlock: Wrapped:{{ $result.Wrapped  }}|Inner:{{ $result.Inner }}
 {{ .Content }}
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-                       NeedsOsFS:   false,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        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\">&#34;this highlight shortcode&#34;</span><span class=\"p\">)</span></code>:End.",
@@ -103,13 +97,7 @@ xəx := 0
 {{ .Content }}
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-                       NeedsOsFS:   false,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
                <span class="nx">xəx</span>
index 2c71c1d1a9f0507c0f8c3e925804ab66dfa7fcf9..291bfdbf71b174a2d9347a3728075453d2ea2506 100644 (file)
@@ -114,11 +114,7 @@ Content: {{ .Content }}
        
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               }).Build()
+       b := hugolib.Test(t, files)
 
        expect := `
 P1 Fragments: [p1-title]       
index 0761de2499db2c71ef7c88806b96601522c59037..763499113366ccdc3551505305d3a102415f57c2 100644 (file)
@@ -20,7 +20,6 @@ import (
 )
 
 func TestGroupByLocalizedDate(t *testing.T) {
-
        files := `
 -- config.toml --
 defaultContentLanguage = 'en'
@@ -72,7 +71,6 @@ date: "2020-02-01"
 }
 
 func TestPagesSortCollation(t *testing.T) {
-
        files := `
 -- config.toml --
 defaultContentLanguage = 'en'
@@ -166,12 +164,7 @@ RelPermalink: {{ .RelPermalink }}
 
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               }).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/a/c/d/index.html", "RelPermalink: /a/c/d/")
-
 }
index 4eaac8e2777dfc50a0434ab3e3cdfb0795299c35..969e09c36463318d4ab7a822335a41ec3e83fad8 100644 (file)
@@ -59,11 +59,7 @@ LangURL: {{ relLangURL "foo" }}
 
        `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               }).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/en/index.html", `
                Hello1: Hello
index 9540b0976db2a902cd4d7a56cfa74c46c548dd33..a0b35196a66696d531614c216925ecf395aeb4f8 100644 (file)
@@ -156,11 +156,7 @@ resize 2|RelPermalink: {{ $image.RelPermalink }}|MediaType: {{ $image.MediaType
 
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               }).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html",
                "jpg|RelPermalink: /images/pixel_hu8aa3346827e49d756ff4e630147c42b5_70_filter_17010532266664966692.jpg|MediaType: image/jpeg|Width: 1|Height: 1|",
index 24727a12c1519b1d57f6f8ee944c86c6238c0f27..1bcabb447ab9a388e79b5eadc5905ec6b589d991 100644 (file)
@@ -32,12 +32,7 @@ baseURL = 'http://example.com/'
 {{ return "foo"}}
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
        [foo foo foo]
@@ -89,12 +84,7 @@ func TestAppendSliceToASliceOfSlices(t *testing.T) {
 
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", "[[a] [b] [c]]")
 }
@@ -113,12 +103,7 @@ func TestAppendNilToSlice(t *testing.T) {
 
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", "[a &lt;nil&gt;]")
 }
@@ -180,12 +165,7 @@ title: "p3"
 {{< lorem 60 >}}
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 Home: p1|p3|
@@ -218,12 +198,7 @@ foo: bc
   {{- end -}}
 </ul>
   `
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
        b.AssertFileContent("public/index.html", "<ul><li>P1</li><li>P2</li></ul>")
 }
 
@@ -246,12 +221,7 @@ boolf = false
 {{ echoParam .Site.Params.footer "boolf" }}
        `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
        b.AssertFileContent("public/index.html",
                "foo",
                "42",
index 81f35e39cc54e0d2bef86ba58aea1f11599ecfbc..003422aedaf6591b29da9b4de34aebd2b70d63fa 100644 (file)
@@ -40,12 +40,7 @@ imageConfig2 OK: {{ (imageConfig $path2).Width }}|
 
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 fileExists OK: true|
index 632c3b64e920ceccd00de03eb9abe71258e38224..22f6323ddae0b6fd95b173bc2c31372cbec395f6 100644 (file)
@@ -196,12 +196,7 @@ title: "P1"
 {{ .Content }}
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/p1/index.html", "<nav id=\"TableOfContents\"></nav> \n<h1 id=\"heading-1\">Heading 1</h1>")
 }
index e48f3bb208af8c7823c7917d36d77aed40d49221..f2bde29c314999abce59ef473a6710eed1aefe04 100644 (file)
@@ -39,12 +39,7 @@ partial: {{ partials.Include "foo.html" . }}
 foo
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 partial: foo
@@ -64,12 +59,7 @@ partialCached: {{ partials.IncludeCached "foo.html" . }}
 foo
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 partialCached: foo
@@ -93,12 +83,7 @@ P2
 
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 P2
@@ -130,12 +115,7 @@ P2
 
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 SHORT
@@ -180,12 +160,7 @@ D1
 
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        // fmt.Println(b.FileContent("public/index.html"))
 
@@ -340,12 +315,7 @@ FOO:{{ $r.Content }}
 BAR
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", "OO:BAR")
 }
index 02aa5d29d4813a4d3017604d5dbc2252fef35962..5a3c296665a4e30541ff65b1287f5938a5e71b38 100644 (file)
@@ -54,11 +54,7 @@ Copy3: {{ $copy3.RelPermalink}}|{{ $copy3.MediaType }}|{{ $copy3.Content | safeJ
 
        `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               }).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 Image Orig:  /blog/images/pixel.png|image/png|1|1|
@@ -112,11 +108,7 @@ iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAA
 
        `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               }).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 Image OK
index 7e0bcc82448c0afac37f262280c75b7f67d80183..301f783a573f2557f900b4e49e18c6dcb0ba84d3 100644 (file)
@@ -34,12 +34,7 @@ partials/doesnotexist.html: {{ templates.Exists "partials/doesnotexist.html" }}
 -- layouts/partials/foo.html --
   `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 index.html: true
@@ -69,12 +64,7 @@ post/doesnotexist.html: {{ templates.Exists "post/doesnotexist.html" }}
 
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 index.html: true
@@ -96,12 +86,7 @@ Home: {{ page.IsHome }}
 
 `
 
-       b := hugolib.NewIntegrationTestBuilder(
-               hugolib.IntegrationTestConfig{
-                       T:           t,
-                       TxtarString: files,
-               },
-       ).Build()
+       b := hugolib.Test(t, files)
 
        b.AssertFileContent("public/index.html", `
 Home: true