diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-04-15 16:42:54 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-04-15 18:08:06 +0200 |
commit | 417c5e2b67b97fa80a0b6f77d259966f03b95344 (patch) | |
tree | 9012bff91acfd5656c68450556909d6f258cc236 /hugolib/page_test.go | |
parent | 94c8b29c39d0c485ee91d98c08fd615c28802496 (diff) |
Make Page.Content a method that returns interface{}
To prepare for a `Resource.Content` method.
See #4622
Diffstat (limited to 'hugolib/page_test.go')
-rw-r--r-- | hugolib/page_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/hugolib/page_test.go b/hugolib/page_test.go index 2b679c842..308bf31cb 100644 --- a/hugolib/page_test.go +++ b/hugolib/page_test.go @@ -481,7 +481,7 @@ func checkPageTitle(t *testing.T, page *Page, title string) { func checkPageContent(t *testing.T, page *Page, content string, msg ...interface{}) { a := normalizeContent(content) - b := normalizeContent(string(page.Content)) + b := normalizeContent(string(page.content)) if a != b { t.Fatalf("Page content is:\n%q\nExpected:\n%q (%q)", b, a, msg) } @@ -616,7 +616,7 @@ func testAllMarkdownEnginesForPages(t *testing.T, require.NoError(t, err) require.NotNil(t, home) require.Equal(t, homePath, home.Path()) - require.Contains(t, home.Content, "Home Page Content") + require.Contains(t, home.content, "Home Page Content") } @@ -726,8 +726,8 @@ func TestPageWithDelimiterForMarkdownThatCrossesBorder(t *testing.T) { t.Fatalf("Got summary:\n%q", p.Summary) } - if p.Content != template.HTML("<p>The <a href=\"http://gohugo.io/\">best static site generator</a>.<sup class=\"footnote-ref\" id=\"fnref:1\"><a href=\"#fn:1\">1</a></sup>\n</p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:1\">Many people say so.\n <a class=\"footnote-return\" href=\"#fnref:1\"><sup>[return]</sup></a></li>\n</ol>\n</div>") { - t.Fatalf("Got content:\n%q", p.Content) + if p.content != template.HTML("<p>The <a href=\"http://gohugo.io/\">best static site generator</a>.<sup class=\"footnote-ref\" id=\"fnref:1\"><a href=\"#fn:1\">1</a></sup>\n</p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:1\">Many people say so.\n <a class=\"footnote-return\" href=\"#fnref:1\"><sup>[return]</sup></a></li>\n</ol>\n</div>") { + t.Fatalf("Got content:\n%q", p.content) } } @@ -1511,7 +1511,7 @@ func TestPageSimpleMethods(t *testing.T) { } { p, _ := s.NewPage("Test") - p.Content = "<h1>Do Be Do Be Do</h1>" + p.content = "<h1>Do Be Do Be Do</h1>" if !this.assertFunc(p) { t.Errorf("[%d] Page method error", i) } |