summaryrefslogtreecommitdiffstats
path: root/parser/frontmatter_test.go
diff options
context:
space:
mode:
authorbep <bjorn.erik.pedersen@gmail.com>2015-03-10 23:17:39 +0100
committerbep <bjorn.erik.pedersen@gmail.com>2015-03-10 23:17:39 +0100
commitf85d1a7da25fb1d0d6491eabee2860058095fbec (patch)
tree92db8b7d15d49c1a4a3021929e3d6ec1e96a728e /parser/frontmatter_test.go
parentc641ffea3af2ab16c6449574ea865f2ef10a448e (diff)
parser: add some frontmatter test cases
Diffstat (limited to 'parser/frontmatter_test.go')
-rw-r--r--parser/frontmatter_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/parser/frontmatter_test.go b/parser/frontmatter_test.go
new file mode 100644
index 000000000..33db0a24a
--- /dev/null
+++ b/parser/frontmatter_test.go
@@ -0,0 +1,25 @@
+package parser
+
+import (
+ "testing"
+)
+
+func TestFormatToLeadRune(t *testing.T) {
+ for i, this := range []struct {
+ kind string
+ expect rune
+ }{
+ {"yaml", '-'},
+ {"yml", '-'},
+ {"toml", '+'},
+ {"json", '{'},
+ {"js", '{'},
+ {"unknown", '+'},
+ } {
+ result := FormatToLeadRune(this.kind)
+
+ if result != this.expect {
+ t.Errorf("[%d] Got %q but expected %q", i, result, this.expect)
+ }
+ }
+}