shithub: hugo

ref: 0c98d8e9ed7013ce722d53ee094f1adc79b90079
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)
		}
	}
}