shitty-ssg/cmd/ssg/site/meta_test.go

38 lines
650 B
Go
Raw Normal View History

package site_test
import (
"testing"
2024-09-17 07:39:49 +02:00
"go-mod.ewintr.nl/go-kit/test"
"go-mod.ewintr.nl/shitty-ssg/cmd/ssg/site"
"go-mod.ewintr.nl/shitty-ssg/pkg/adoc"
)
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))
})
}
}