From bf76e744321c7a51f546a09df0af2c009ff0d779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 23 Mar 2016 15:02:00 +0100 Subject: [PATCH] parser: Fix ALL_CAPS var names in test --- parser/parse_frontmatter_test.go | 56 ++++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/parser/parse_frontmatter_test.go b/parser/parse_frontmatter_test.go index babad351f..cbf6c1bc5 100644 --- a/parser/parse_frontmatter_test.go +++ b/parser/parse_frontmatter_test.go @@ -26,20 +26,20 @@ import ( ) var ( - CONTENT_NO_FRONTMATTER = "a page with no front matter" - CONTENT_WITH_FRONTMATTER = "---\ntitle: front matter\n---\nContent with front matter" - CONTENT_HTML_NODOCTYPE = "\n\t\n\t\n" - CONTENT_HTML_WITHDOCTYPE = "" - CONTENT_HTML_WITH_FRONTMATTER = "---\ntitle: front matter\n---\n" - CONTENT_LWS_HTML = " " - CONTENT_LWS_LF_HTML = "\n" - CONTENT_INCOMPLETE_END_FM_DELIM = "---\ntitle: incomplete end fm delim\n--\nincomplete frontmatter delim" - CONTENT_MISSING_END_FM_DELIM = "---\ntitle: incomplete end fm delim\nincomplete frontmatter delim" - CONTENT_SLUG_WORKING = "---\ntitle: slug doc 2\nslug: slug-doc-2\n\n---\nslug doc 2 content" - CONTENT_SLUG_WORKING_VARIATION = "---\ntitle: slug doc 3\nslug: slug-doc 3\n---\nslug doc 3 content" - CONTENT_SLUG_BUG = "---\ntitle: slug doc 2\nslug: slug-doc-2\n---\nslug doc 2 content" - CONTENT_WITH_JS_FM = "{\n \"categories\": \"d\",\n \"tags\": [\n \"a\", \n \"b\", \n \"c\"\n ]\n}\nJSON Front Matter with tags and categories" - CONTENT_WITH_JS_LOOSE_FM = "{\n \"categories\": \"d\"\n \"tags\": [\n \"a\" \n \"b\" \n \"c\"\n ]\n}\nJSON Front Matter with tags and categories" + contentNoFrontmatter = "a page with no front matter" + contentWithFrontmatter = "---\ntitle: front matter\n---\nContent with front matter" + contentHTMLNoDoctype = "\n\t\n\t\n" + contentHTMLWithDoctype = "" + contentHTMLWithFrontmatter = "---\ntitle: front matter\n---\n" + contentHTML = " " + contentLinefeedAndHTML = "\n" + contentIncompleteEndFrontmatterDelim = "---\ntitle: incomplete end fm delim\n--\nincomplete frontmatter delim" + contentMissingEndFrontmatterDelim = "---\ntitle: incomplete end fm delim\nincomplete frontmatter delim" + contentSlugWorking = "---\ntitle: slug doc 2\nslug: slug-doc-2\n\n---\nslug doc 2 content" + contentSlugWorkingVariation = "---\ntitle: slug doc 3\nslug: slug-doc 3\n---\nslug doc 3 content" + contentSlugBug = "---\ntitle: slug doc 2\nslug: slug-doc-2\n---\nslug doc 2 content" + contentSlugWithJSONFrontMatter = "{\n \"categories\": \"d\",\n \"tags\": [\n \"a\", \n \"b\", \n \"c\"\n ]\n}\nJSON Front Matter with tags and categories" + contentWithJSONLooseFrontmatter = "{\n \"categories\": \"d\"\n \"tags\": [\n \"a\" \n \"b\" \n \"c\"\n ]\n}\nJSON Front Matter with tags and categories" ) var lineEndings = []string{"\n", "\r\n"} @@ -56,8 +56,8 @@ func TestDegenerateCreatePageFrom(t *testing.T) { tests := []struct { content string }{ - {CONTENT_MISSING_END_FM_DELIM}, - {CONTENT_INCOMPLETE_END_FM_DELIM}, + {contentMissingEndFrontmatterDelim}, + {contentIncompleteEndFrontmatterDelim}, } for _, test := range tests { @@ -108,18 +108,18 @@ func TestStandaloneCreatePageFrom(t *testing.T) { bodycontent string }{ - {CONTENT_NO_FRONTMATTER, true, true, "", "a page with no front matter"}, - {CONTENT_WITH_FRONTMATTER, true, false, "---\ntitle: front matter\n---\n", "Content with front matter"}, - {CONTENT_HTML_NODOCTYPE, false, true, "", "\n\t\n\t\n"}, - {CONTENT_HTML_WITHDOCTYPE, false, true, "", ""}, - {CONTENT_HTML_WITH_FRONTMATTER, true, false, "---\ntitle: front matter\n---\n", ""}, - {CONTENT_LWS_HTML, false, true, "", ""}, - {CONTENT_LWS_LF_HTML, false, true, "", ""}, - {CONTENT_WITH_JS_FM, true, false, "{\n \"categories\": \"d\",\n \"tags\": [\n \"a\", \n \"b\", \n \"c\"\n ]\n}", "JSON Front Matter with tags and categories"}, - {CONTENT_WITH_JS_LOOSE_FM, true, false, "{\n \"categories\": \"d\"\n \"tags\": [\n \"a\" \n \"b\" \n \"c\"\n ]\n}", "JSON Front Matter with tags and categories"}, - {CONTENT_SLUG_WORKING, true, false, "---\ntitle: slug doc 2\nslug: slug-doc-2\n\n---\n", "slug doc 2 content"}, - {CONTENT_SLUG_WORKING_VARIATION, true, false, "---\ntitle: slug doc 3\nslug: slug-doc 3\n---\n", "slug doc 3 content"}, - {CONTENT_SLUG_BUG, true, false, "---\ntitle: slug doc 2\nslug: slug-doc-2\n---\n", "slug doc 2 content"}, + {contentNoFrontmatter, true, true, "", "a page with no front matter"}, + {contentWithFrontmatter, true, false, "---\ntitle: front matter\n---\n", "Content with front matter"}, + {contentHTMLNoDoctype, false, true, "", "\n\t\n\t\n"}, + {contentHTMLWithDoctype, false, true, "", ""}, + {contentHTMLWithFrontmatter, true, false, "---\ntitle: front matter\n---\n", ""}, + {contentHTML, false, true, "", ""}, + {contentLinefeedAndHTML, false, true, "", ""}, + {contentSlugWithJSONFrontMatter, true, false, "{\n \"categories\": \"d\",\n \"tags\": [\n \"a\", \n \"b\", \n \"c\"\n ]\n}", "JSON Front Matter with tags and categories"}, + {contentWithJSONLooseFrontmatter, true, false, "{\n \"categories\": \"d\"\n \"tags\": [\n \"a\" \n \"b\" \n \"c\"\n ]\n}", "JSON Front Matter with tags and categories"}, + {contentSlugWorking, true, false, "---\ntitle: slug doc 2\nslug: slug-doc-2\n\n---\n", "slug doc 2 content"}, + {contentSlugWorkingVariation, true, false, "---\ntitle: slug doc 3\nslug: slug-doc 3\n---\n", "slug doc 3 content"}, + {contentSlugBug, true, false, "---\ntitle: slug doc 2\nslug: slug-doc-2\n---\n", "slug doc 2 content"}, } for _, test := range tests {