From 206440eef2d1ba94b0e5f6057eac479f730dbe94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 12 Apr 2016 19:18:02 +0200 Subject: [PATCH] Fix broken tests --- hugolib/handler_test.go | 6 +++--- hugolib/page_test.go | 6 +++--- hugolib/shortcode_test.go | 4 ++-- hugolib/site_test.go | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hugolib/handler_test.go b/hugolib/handler_test.go index 29b1161e4..ee5913634 100644 --- a/hugolib/handler_test.go +++ b/hugolib/handler_test.go @@ -63,14 +63,14 @@ func TestDefaultHandler(t *testing.T) { doc string expected string }{ - {filepath.FromSlash("sect/doc1.html"), "\n\n

title

\n\n

some content

\n"}, + {filepath.FromSlash("sect/doc1.html"), "\n\n

title

\n\n

some content

\n"}, {filepath.FromSlash("sect/doc2.html"), "more content"}, - {filepath.FromSlash("sect/doc3.html"), "\n\n

doc3

\n\n

some content

\n"}, + {filepath.FromSlash("sect/doc3.html"), "\n\n

doc3

\n\n

some content

\n"}, {filepath.FromSlash("sect/doc3/img1.png"), string([]byte("‰PNG  ��� IHDR����������:~›U��� IDATWcø��ZMoñ����IEND®B`‚"))}, {filepath.FromSlash("sect/img2.gif"), string([]byte("GIF89a��€��ÿÿÿ���,�������D�;"))}, {filepath.FromSlash("sect/img2.spf"), string([]byte("****FAKE-FILETYPE****"))}, {filepath.FromSlash("doc7.html"), "doc7 content"}, - {filepath.FromSlash("sect/doc8.html"), "\n\n

title

\n\n

some content

\n"}, + {filepath.FromSlash("sect/doc8.html"), "\n\n

title

\n\n

some content

\n"}, } for _, test := range tests { diff --git a/hugolib/page_test.go b/hugolib/page_test.go index b492bab2d..c4e442a41 100644 --- a/hugolib/page_test.go +++ b/hugolib/page_test.go @@ -487,7 +487,7 @@ func checkPageTitle(t *testing.T, page *Page, title string) { func checkPageContent(t *testing.T, page *Page, content string) { if page.Content != template.HTML(content) { - t.Fatalf("Page content is: %q\nExpected: %q", page.Content, content) + t.Fatalf("Page content is:\n%q\nExpected:\n%q", page.Content, content) } } @@ -611,8 +611,8 @@ func TestTableOfContents(t *testing.T) { if err != nil { t.Fatalf("Unable to create a page with frontmatter and body content: %s", err) } - checkPageContent(t, p, "\n\n

For some moments the old man did not reply. He stood with bowed head, buried in deep thought. But at last he spoke.

\n\n

AA

\n\n

I have no idea, of course, how long it took me to reach the limit of the plain,\nbut at last I entered the foothills, following a pretty little canyon upward\ntoward the mountains. Beside me frolicked a laughing brooklet, hurrying upon\nits noisy way down to the silent sea. In its quieter pools I discovered many\nsmall fish, of four-or five-pound weight I should imagine. In appearance,\nexcept as to size and color, they were not unlike the whale of our own seas. As\nI watched them playing about I discovered, not only that they suckled their\nyoung, but that at intervals they rose to the surface to breathe as well as to\nfeed upon certain grasses and a strange, scarlet lichen which grew upon the\nrocks just above the water line.

\n\n

AAA

\n\n

I remember I felt an extraordinary persuasion that I was being played with,\nthat presently, when I was upon the very verge of safety, this mysterious\ndeath–as swift as the passage of light–would leap after me from the pit about\nthe cylinder and strike me down. ## BB

\n\n

BBB

\n\n

“You’re a great Granser,” he cried delightedly, “always making believe them little marks mean something.”

\n") - checkPageTOC(t, p, "") + checkPageContent(t, p, "\n\n

For some moments the old man did not reply. He stood with bowed head, buried in deep thought. But at last he spoke.

\n\n

AA

\n\n

I have no idea, of course, how long it took me to reach the limit of the plain,\nbut at last I entered the foothills, following a pretty little canyon upward\ntoward the mountains. Beside me frolicked a laughing brooklet, hurrying upon\nits noisy way down to the silent sea. In its quieter pools I discovered many\nsmall fish, of four-or five-pound weight I should imagine. In appearance,\nexcept as to size and color, they were not unlike the whale of our own seas. As\nI watched them playing about I discovered, not only that they suckled their\nyoung, but that at intervals they rose to the surface to breathe as well as to\nfeed upon certain grasses and a strange, scarlet lichen which grew upon the\nrocks just above the water line.

\n\n

AAA

\n\n

I remember I felt an extraordinary persuasion that I was being played with,\nthat presently, when I was upon the very verge of safety, this mysterious\ndeath–as swift as the passage of light–would leap after me from the pit about\nthe cylinder and strike me down. ## BB

\n\n

BBB

\n\n

“You’re a great Granser,” he cried delightedly, “always making believe them little marks mean something.”

\n") + checkPageTOC(t, p, "") } func TestPageWithMoreTag(t *testing.T) { diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index ab764b845..39a5ae39d 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -176,7 +176,7 @@ func TestInnerSCWithMarkdown(t *testing.T) { [link](http://spf13.com) and text -{{% /inside %}}`, "

More Here

\n\n

link and text

\n
", tem) +{{% /inside %}}`, "

More Here

\n\n

link and text

\n
", tem) } func TestInnerSCWithAndWithoutMarkdown(t *testing.T) { @@ -198,7 +198,7 @@ And then: This is **plain** text. {{< /inside >}} -`, "

More Here

\n\n

link and text

\n
\n\nAnd then:\n\n
\n# More Here\n\nThis is **plain** text.\n\n
\n", tem) +`, "

More Here

\n\n

link and text

\n
\n\nAnd then:\n\n
\n# More Here\n\nThis is **plain** text.\n\n
\n", tem) } func TestEmbeddedSC(t *testing.T) { diff --git a/hugolib/site_test.go b/hugolib/site_test.go index 9f0abc98c..dfef52f4e 100644 --- a/hugolib/site_test.go +++ b/hugolib/site_test.go @@ -149,7 +149,7 @@ func TestRenderThing(t *testing.T) { }{ {pageSimpleTitle, templateTitle, "simple template"}, {pageSimpleTitle, templateFunc, "simple-template"}, - {pageWithMd, templateContent, "\n\n

heading 1

\n\n

text

\n\n

heading 2

\n\n

more text

\n"}, + {pageWithMd, templateContent, "\n\n

heading 1

\n\n

text

\n\n

heading 2

\n\n

more text

\n"}, {simplePageRFC3339Date, templateDate, "2013-05-17 16:59:30 +0000 UTC"}, } @@ -593,14 +593,14 @@ func TestSkipRender(t *testing.T) { doc string expected string }{ - {filepath.FromSlash("sect/doc1.html"), "\n\n

title

\n\n

some content

\n"}, + {filepath.FromSlash("sect/doc1.html"), "\n\n

title

\n\n

some content

\n"}, {filepath.FromSlash("sect/doc2.html"), "more content"}, - {filepath.FromSlash("sect/doc3.html"), "\n\n

doc3

\n\n

some content

\n"}, - {filepath.FromSlash("sect/doc4.html"), "\n\n

doc4

\n\n

some content

\n"}, + {filepath.FromSlash("sect/doc3.html"), "\n\n

doc3

\n\n

some content

\n"}, + {filepath.FromSlash("sect/doc4.html"), "\n\n

doc4

\n\n

some content

\n"}, {filepath.FromSlash("sect/doc5.html"), "body5"}, {filepath.FromSlash("sect/doc6.html"), "body5"}, {filepath.FromSlash("doc7.html"), "doc7 content"}, - {filepath.FromSlash("sect/doc8.html"), "\n\n

title

\n\n

some content

\n"}, + {filepath.FromSlash("sect/doc8.html"), "\n\n

title

\n\n

some content

\n"}, } for _, test := range tests {