summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parser/frontmatter_test.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/parser/frontmatter_test.go b/parser/frontmatter_test.go
index 85c7c1874..2e5bdec50 100644
--- a/parser/frontmatter_test.go
+++ b/parser/frontmatter_test.go
@@ -322,8 +322,8 @@ func TestRemoveTOMLIdentifier(t *testing.T) {
func BenchmarkFrontmatterTags(b *testing.B) {
- for _, frontmatter := range []string{"JSON", "YAML", "TOML"} {
- for i := 1; i < 30; i += 10 {
+ for _, frontmatter := range []string{"JSON", "YAML", "YAML2", "TOML"} {
+ for i := 1; i < 60; i += 20 {
doBenchmarkFrontmatter(b, frontmatter, i)
}
}
@@ -336,6 +336,12 @@ tags:
%s
---
`
+
+ yaml2Template := `---
+name: "Tags"
+tags: %s
+---
+`
tomlTemplate := `+++
name = "Tags"
tags = %s
@@ -364,6 +370,9 @@ tags = %s
} else if fileformat == "JSON" {
frontmatterTemplate = jsonTemplate
tagsStr = strings.Replace(fmt.Sprintf("%q", tags), " ", ", ", -1)
+ } else if fileformat == "YAML2" {
+ frontmatterTemplate = yaml2Template
+ tagsStr = strings.Replace(fmt.Sprintf("%q", tags), " ", ", ", -1)
} else {
frontmatterTemplate = yamlTemplate
for _, tag := range tags {