parser: Fix ALL_CAPS var names in test

This commit is contained in:
Bjørn Erik Pedersen 2016-03-23 15:02:00 +01:00
parent 1cb7ed6ac7
commit bf76e74432

View file

@ -26,20 +26,20 @@ import (
) )
var ( var (
CONTENT_NO_FRONTMATTER = "a page with no front matter" contentNoFrontmatter = "a page with no front matter"
CONTENT_WITH_FRONTMATTER = "---\ntitle: front matter\n---\nContent with front matter" contentWithFrontmatter = "---\ntitle: front matter\n---\nContent with front matter"
CONTENT_HTML_NODOCTYPE = "<html>\n\t<body>\n\t</body>\n</html>" contentHTMLNoDoctype = "<html>\n\t<body>\n\t</body>\n</html>"
CONTENT_HTML_WITHDOCTYPE = "<!doctype html><html><body></body></html>" contentHTMLWithDoctype = "<!doctype html><html><body></body></html>"
CONTENT_HTML_WITH_FRONTMATTER = "---\ntitle: front matter\n---\n<!doctype><html><body></body></html>" contentHTMLWithFrontmatter = "---\ntitle: front matter\n---\n<!doctype><html><body></body></html>"
CONTENT_LWS_HTML = " <html><body></body></html>" contentHTML = " <html><body></body></html>"
CONTENT_LWS_LF_HTML = "\n<html><body></body></html>" contentLinefeedAndHTML = "\n<html><body></body></html>"
CONTENT_INCOMPLETE_END_FM_DELIM = "---\ntitle: incomplete end fm delim\n--\nincomplete frontmatter delim" contentIncompleteEndFrontmatterDelim = "---\ntitle: incomplete end fm delim\n--\nincomplete frontmatter delim"
CONTENT_MISSING_END_FM_DELIM = "---\ntitle: incomplete end fm delim\nincomplete frontmatter delim" contentMissingEndFrontmatterDelim = "---\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" contentSlugWorking = "---\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" contentSlugWorkingVariation = "---\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" contentSlugBug = "---\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" contentSlugWithJSONFrontMatter = "{\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" 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"} var lineEndings = []string{"\n", "\r\n"}
@ -56,8 +56,8 @@ func TestDegenerateCreatePageFrom(t *testing.T) {
tests := []struct { tests := []struct {
content string content string
}{ }{
{CONTENT_MISSING_END_FM_DELIM}, {contentMissingEndFrontmatterDelim},
{CONTENT_INCOMPLETE_END_FM_DELIM}, {contentIncompleteEndFrontmatterDelim},
} }
for _, test := range tests { for _, test := range tests {
@ -108,18 +108,18 @@ func TestStandaloneCreatePageFrom(t *testing.T) {
bodycontent string bodycontent string
}{ }{
{CONTENT_NO_FRONTMATTER, true, true, "", "a page with no front matter"}, {contentNoFrontmatter, true, true, "", "a page with no front matter"},
{CONTENT_WITH_FRONTMATTER, true, false, "---\ntitle: front matter\n---\n", "Content with front matter"}, {contentWithFrontmatter, true, false, "---\ntitle: front matter\n---\n", "Content with front matter"},
{CONTENT_HTML_NODOCTYPE, false, true, "", "<html>\n\t<body>\n\t</body>\n</html>"}, {contentHTMLNoDoctype, false, true, "", "<html>\n\t<body>\n\t</body>\n</html>"},
{CONTENT_HTML_WITHDOCTYPE, false, true, "", "<!doctype html><html><body></body></html>"}, {contentHTMLWithDoctype, false, true, "", "<!doctype html><html><body></body></html>"},
{CONTENT_HTML_WITH_FRONTMATTER, true, false, "---\ntitle: front matter\n---\n", "<!doctype><html><body></body></html>"}, {contentHTMLWithFrontmatter, true, false, "---\ntitle: front matter\n---\n", "<!doctype><html><body></body></html>"},
{CONTENT_LWS_HTML, false, true, "", "<html><body></body></html>"}, {contentHTML, false, true, "", "<html><body></body></html>"},
{CONTENT_LWS_LF_HTML, false, true, "", "<html><body></body></html>"}, {contentLinefeedAndHTML, false, true, "", "<html><body></body></html>"},
{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"}, {contentSlugWithJSONFrontMatter, 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"}, {contentWithJSONLooseFrontmatter, 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"}, {contentSlugWorking, 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"}, {contentSlugWorkingVariation, 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"}, {contentSlugBug, true, false, "---\ntitle: slug doc 2\nslug: slug-doc-2\n---\n", "slug doc 2 content"},
} }
for _, test := range tests { for _, test := range tests {