diff options
author | spf13 <steve.francia@gmail.com> | 2013-10-01 22:45:24 -0400 |
---|---|---|
committer | spf13 <steve.francia@gmail.com> | 2013-10-01 22:45:24 -0400 |
commit | 18f2b82658b6f0ea82c867c2c4d40cf0772841d2 (patch) | |
tree | 3ce431d4f88a610ac2c353134d547f971d4c3f98 /parser | |
parent | 48e1068e3e7082615df462c1df186e6045f3ca45 (diff) |
Switching to the rjson library which is more friendly to human generated json.
Diffstat (limited to 'parser')
-rw-r--r-- | parser/parse_frontmatter_test.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/parser/parse_frontmatter_test.go b/parser/parse_frontmatter_test.go index 6d65d9dcb..87666542a 100644 --- a/parser/parse_frontmatter_test.go +++ b/parser/parse_frontmatter_test.go @@ -29,6 +29,7 @@ var ( CONTENT_SLUG_BUG = "---\ntitle: slug doc 2\nslug: slug-doc-2\n---\nslug doc 2 content" CONTENT_FM_NO_DOC = "---\ntitle: no doc\n---" 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" ) var lineEndings = []string{"\n", "\r\n"} @@ -113,6 +114,7 @@ func TestStandaloneCreatePageFrom(t *testing.T) { {CONTENT_LWS_HTML, false, true, "", "<html><body></body></html>"}, {CONTENT_LWS_LF_HTML, 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"}, + {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"}, @@ -281,6 +283,7 @@ func TestExtractFrontMatterDelim(t *testing.T) { {"{ { } { } }", "{ { } { } }", noErrExpected}, {"{\n{\n}\n}\n", "{\n{\n}\n}", noErrExpected}, {"{\n \"categories\": \"d\",\n \"tags\": [\n \"a\", \n \"b\", \n \"c\"\n ]\n}\nJSON Front Matter with tags and categories", "{\n \"categories\": \"d\",\n \"tags\": [\n \"a\", \n \"b\", \n \"c\"\n ]\n}", noErrExpected}, + {"{\n \"categories\": \"d\"\n \"tags\": [\n \"a\" \n \"b\" \n \"c\"\n ]\n}\nJSON Front Matter with tags and categories", "{\n \"categories\": \"d\"\n \"tags\": [\n \"a\" \n \"b\" \n \"c\"\n ]\n}", noErrExpected}, } for _, test := range tests { |