iso639/iso_639_test.go

24 lines
498 B
Go
Raw Normal View History

2023-10-01 08:51:38 +02:00
package iso639
import "testing"
func TestGetLanguageNameForISO639Code(t *testing.T) {
data := map[string]string{
"nl": "Dutch", // ISO 639-1
"nld": "Dutch", // ISO 639-2/B
"dut": "Dutch", // ISO 639-2/T
"NL": "",
"NLD": "",
"DUT": "",
"gfedgjhgrh": "",
"GIJGKDJ": "",
}
for code, name := range data {
result, _ := GetLanguageNameForISO639Code(code)
if result != name {
t.Errorf("got %q, wanted %q", result, name)
}
}
}