From 3e1d3914c2a7e702b1aab7babd3432fbdb6b8c1d Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 18 Sep 2026 21:44:48 +0200 Subject: [PATCH] Test the ISO 639, IANA status and media type registers the misc tables should hold --- data_test.go | 3 ++- table_test.go | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/data_test.go b/data_test.go index 33af38e..3583400 100644 --- a/data_test.go +++ b/data_test.go @@ -103,9 +103,10 @@ func TestShippedMiscReferenceData(t *testing.T) { "country.alpha3": regexp.MustCompile(`^[A-Z]{3}$`), "language": regexp.MustCompile(`\p{L}`), "language.code": regexp.MustCompile(`^[a-z]{2}$`), + "language.code3": regexp.MustCompile(`^[a-z]{3}$`), "timezone": regexp.MustCompile(`^([A-Za-z_]+(/[A-Za-z_]+)+|UTC)$`), "mimetype": regexp.MustCompile(`^[a-z]+/[a-z0-9.+-]+$`), - "mimetype.ext": regexp.MustCompile(`^\.[a-z0-9]+$`), + "mimetype.ext": regexp.MustCompile(`^\.[a-z0-9_-]+$`), "httpstatus": regexp.MustCompile(`^[1-5]\d{2} \S.*$`), "httpstatus.code": regexp.MustCompile(`^[1-5]\d{2}$`), "useragent": regexp.MustCompile(`^Mozilla/5\.0 .+`), diff --git a/table_test.go b/table_test.go index e912adb..9772dbc 100644 --- a/table_test.go +++ b/table_test.go @@ -676,9 +676,15 @@ func TestShippedTables(t *testing.T) { "currency[SEK].decimals": "2", "currency[Euro].code": "EUR", "language[sv]": "Swedish", + "language[sv].code3": "swe", + "language[Swedish].code": "sv", + "language[nl]": "Dutch", "httpstatus[404]": "404 Not Found", "httpstatus[404].reason": "Not Found", + "httpstatus[451].reason": "Unavailable For Legal Reasons", "mimetype[application/json].ext": ".json", + "mimetype[text/markdown].ext": ".md", + "mimetype[.jpg]": "image/jpeg", } { if got := fake(t, f, path); got != want { t.Errorf("Fake(%q) = %q, want %q", path, got, want)