From 32336e9ec6d4a17bb13c30ca98233adf494ba03b Mon Sep 17 00:00:00 2001 From: bogem Date: Mon, 21 Nov 2016 23:02:19 +0100 Subject: [PATCH] hugolib: Camelcase ALL_CAPS vars and const in tests See #2014 --- hugolib/path_separators_test.go | 8 ++++---- hugolib/sitemap_test.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hugolib/path_separators_test.go b/hugolib/path_separators_test.go index 013837279..159718440 100644 --- a/hugolib/path_separators_test.go +++ b/hugolib/path_separators_test.go @@ -19,14 +19,14 @@ import ( "testing" ) -var SIMPLE_PAGE_YAML = `--- +var simplePageYAML = `--- contenttype: "" --- Sample Text ` func TestDegenerateMissingFolderInPageFilename(t *testing.T) { - p, err := NewPageFrom(strings.NewReader(SIMPLE_PAGE_YAML), filepath.Join("foobar")) + p, err := NewPageFrom(strings.NewReader(simplePageYAML), filepath.Join("foobar")) if err != nil { t.Fatalf("Error in NewPageFrom") } @@ -48,9 +48,9 @@ func TestNewPageWithFilePath(t *testing.T) { } for i, el := range toCheck { - p, err := NewPageFrom(strings.NewReader(SIMPLE_PAGE_YAML), el.input) + p, err := NewPageFrom(strings.NewReader(simplePageYAML), el.input) if err != nil { - t.Errorf("[%d] Reading from SIMPLE_PAGE_YAML resulted in an error: %s", i, err) + t.Errorf("[%d] Reading from simplePageYAML resulted in an error: %s", i, err) } if p.Section() != el.section { t.Errorf("[%d] Section incorrect page %s. got %s but expected %s", i, el.input, p.Section(), el.section) diff --git a/hugolib/sitemap_test.go b/hugolib/sitemap_test.go index 72fcb2048..aba47ae7d 100644 --- a/hugolib/sitemap_test.go +++ b/hugolib/sitemap_test.go @@ -23,7 +23,7 @@ import ( "github.com/spf13/viper" ) -const SITEMAP_TEMPLATE = ` +const sitemapTemplate = ` {{ range .Data.Pages }} {{ .Permalink }} @@ -56,7 +56,7 @@ func doTestSitemapOutput(t *testing.T, internal bool) { } } else { - if err := buildAndRenderSite(s, "sitemap.xml", SITEMAP_TEMPLATE); err != nil { + if err := buildAndRenderSite(s, "sitemap.xml", sitemapTemplate); err != nil { t.Fatalf("Failed to build site: %s", err) } }