mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-24 19:22:00 +00:00
26 lines
401 B
Go
26 lines
401 B
Go
|
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)
|
||
|
}
|
||
|
}
|
||
|
}
|