shithub: hugo

ref: 658cfb287ec8af3c97633e19a2b584d5a9b0ecc2
dir: /parser/frontmatter_test.go/

View raw version
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)
		}
	}
}