2020-12-21 07:36:45 +01:00
|
|
|
package site_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2021-09-30 07:10:33 +02:00
|
|
|
"ewintr.nl/go-kit/test"
|
|
|
|
"ewintr.nl/shitty-ssg/cmd/ssg/site"
|
|
|
|
"ewintr.nl/shitty-ssg/pkg/adoc"
|
2020-12-21 07:36:45 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestNewLanguage(t *testing.T) {
|
|
|
|
for _, tc := range []struct {
|
|
|
|
name string
|
|
|
|
input adoc.Language
|
|
|
|
exp site.Language
|
|
|
|
}{
|
|
|
|
{
|
|
|
|
name: "nl",
|
|
|
|
input: adoc.LANGUAGE_NL,
|
|
|
|
exp: site.LANGUAGE_NL,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "en",
|
|
|
|
input: adoc.LANGUAGE_EN,
|
|
|
|
exp: site.LANGUAGE_EN,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "unknown",
|
|
|
|
input: adoc.LANGUAGE_UNKNOWN,
|
|
|
|
exp: site.LANGUAGE_EN,
|
|
|
|
},
|
|
|
|
} {
|
|
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
|
|
test.Equals(t, tc.exp, site.NewLanguage(tc.input))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|