diff options
author | Bjørn Erik Pedersen <[email protected]> | 2020-12-02 13:23:25 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2020-12-03 13:12:58 +0100 |
commit | d90e37e0c6e812f9913bf256c9c81aa05b7a08aa (patch) | |
tree | 7b1b14464eefec1188ca2eed53c64e4823453cc9 /hugolib/hugo_sites_build_test.go | |
parent | 32471b57bde51c55a15dbf1db75d6e5f7232c347 (diff) | |
download | hugo-d90e37e0c6e812f9913bf256c9c81aa05b7a08aa.tar.gz hugo-d90e37e0c6e812f9913bf256c9c81aa05b7a08aa.zip |
all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
Diffstat (limited to 'hugolib/hugo_sites_build_test.go')
-rw-r--r-- | hugolib/hugo_sites_build_test.go | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/hugolib/hugo_sites_build_test.go b/hugolib/hugo_sites_build_test.go index 8d0872bd5..4d6a8697c 100644 --- a/hugolib/hugo_sites_build_test.go +++ b/hugolib/hugo_sites_build_test.go @@ -2,10 +2,9 @@ package hugolib import ( "fmt" + "path/filepath" "strings" "testing" - - "path/filepath" "time" qt "github.com/frankban/quicktest" @@ -199,7 +198,6 @@ p1 = "p1en" } func TestMultiSitesBuild(t *testing.T) { - for _, config := range []struct { content string suffix string @@ -208,7 +206,6 @@ func TestMultiSitesBuild(t *testing.T) { {multiSiteYAMLConfigTemplate, "yml"}, {multiSiteJSONConfigTemplate, "json"}, } { - t.Run(config.suffix, func(t *testing.T) { t.Parallel() doTestMultiSitesBuild(t, config.content, config.suffix) @@ -245,7 +242,7 @@ func doTestMultiSitesBuild(t *testing.T, configTemplate, configSuffix string) { c.Assert(enSite.language.Lang, qt.Equals, "en") - //dumpPages(enSite.RegularPages()...) + // dumpPages(enSite.RegularPages()...) c.Assert(len(enSite.RegularPages()), qt.Equals, 5) c.Assert(len(enSite.AllPages()), qt.Equals, 32) @@ -412,7 +409,6 @@ func doTestMultiSitesBuild(t *testing.T, configTemplate, configSuffix string) { c.Assert(logoEn, qt.Not(qt.IsNil)) b.AssertFileContent("public/en/bundles/b1/index.html", "Resources: image/png: /blog/en/bundles/b1/logo.png") b.AssertFileContent("public/en/bundles/b1/logo.png", "PNG Data") - } func TestMultiSitesRebuild(t *testing.T) { @@ -470,7 +466,6 @@ func TestMultiSitesRebuild(t *testing.T) { []fsnotify.Event{{Name: filepath.FromSlash("content/sect/doc2.en.md"), Op: fsnotify.Remove}}, func(t *testing.T) { c.Assert(len(enSite.RegularPages()), qt.Equals, 4, qt.Commentf("1 en removed")) - }, }, { @@ -508,7 +503,6 @@ func TestMultiSitesRebuild(t *testing.T) { c.Assert(len(enSite.RegularPages()), qt.Equals, 6) doc1 := readDestination(t, fs, "public/en/sect/doc1-slug/index.html") c.Assert(strings.Contains(doc1, "CHANGED"), qt.Equals, true) - }, }, // Rename a file @@ -527,7 +521,8 @@ func TestMultiSitesRebuild(t *testing.T) { c.Assert(enSite.RegularPages()[1].Title(), qt.Equals, "new_en_1") rendered := readDestination(t, fs, "public/en/new1renamed/index.html") c.Assert(rendered, qt.Contains, "new_en_1") - }}, + }, + }, { // Change a template func(t *testing.T) { @@ -567,7 +562,6 @@ func TestMultiSitesRebuild(t *testing.T) { c.Assert(homeEn, qt.Not(qt.IsNil)) c.Assert(len(homeEn.Translations()), qt.Equals, 3) c.Assert(homeEn.Translations()[0].Language().Lang, qt.Equals, "fr") - }, }, // Change a shortcode @@ -593,14 +587,12 @@ func TestMultiSitesRebuild(t *testing.T) { } err := b.H.Build(BuildCfg{}, this.events...) - if err != nil { t.Fatalf("[%d] Failed to rebuild sites: %s", i, err) } this.assertFunc(t) } - } // https://github.com/gohugoio/hugo/issues/4706 @@ -762,7 +754,6 @@ Title: My categories `) for _, lang := range []string{"en", "nn"} { - b.WithContent(lang+"/mysection/page.md", ` --- Title: My Page @@ -770,7 +761,6 @@ categories: ["mycat"] --- `) - } b.Build(BuildCfg{}) @@ -781,7 +771,6 @@ categories: ["mycat"] "/categories", "/categories/mycat", } { - t.Run(path, func(t *testing.T) { c := qt.New(t) @@ -802,7 +791,6 @@ categories: ["mycat"] c.Assert(len(m1), qt.Equals, 1) c.Assert(len(m2), qt.Equals, 1) }) - } } |