Read misc.language, httpstatus and mimetype from their registers #22
+2
-1
@@ -103,9 +103,10 @@ func TestShippedMiscReferenceData(t *testing.T) {
|
|||||||
"country.alpha3": regexp.MustCompile(`^[A-Z]{3}$`),
|
"country.alpha3": regexp.MustCompile(`^[A-Z]{3}$`),
|
||||||
"language": regexp.MustCompile(`\p{L}`),
|
"language": regexp.MustCompile(`\p{L}`),
|
||||||
"language.code": regexp.MustCompile(`^[a-z]{2}$`),
|
"language.code": regexp.MustCompile(`^[a-z]{2}$`),
|
||||||
|
"language.code3": regexp.MustCompile(`^[a-z]{3}$`),
|
||||||
"timezone": regexp.MustCompile(`^([A-Za-z_]+(/[A-Za-z_]+)+|UTC)$`),
|
"timezone": regexp.MustCompile(`^([A-Za-z_]+(/[A-Za-z_]+)+|UTC)$`),
|
||||||
"mimetype": regexp.MustCompile(`^[a-z]+/[a-z0-9.+-]+$`),
|
"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": regexp.MustCompile(`^[1-5]\d{2} \S.*$`),
|
||||||
"httpstatus.code": regexp.MustCompile(`^[1-5]\d{2}$`),
|
"httpstatus.code": regexp.MustCompile(`^[1-5]\d{2}$`),
|
||||||
"useragent": regexp.MustCompile(`^Mozilla/5\.0 .+`),
|
"useragent": regexp.MustCompile(`^Mozilla/5\.0 .+`),
|
||||||
|
|||||||
@@ -676,9 +676,15 @@ func TestShippedTables(t *testing.T) {
|
|||||||
"currency[SEK].decimals": "2",
|
"currency[SEK].decimals": "2",
|
||||||
"currency[Euro].code": "EUR",
|
"currency[Euro].code": "EUR",
|
||||||
"language[sv]": "Swedish",
|
"language[sv]": "Swedish",
|
||||||
|
"language[sv].code3": "swe",
|
||||||
|
"language[Swedish].code": "sv",
|
||||||
|
"language[nl]": "Dutch",
|
||||||
"httpstatus[404]": "404 Not Found",
|
"httpstatus[404]": "404 Not Found",
|
||||||
"httpstatus[404].reason": "Not Found",
|
"httpstatus[404].reason": "Not Found",
|
||||||
|
"httpstatus[451].reason": "Unavailable For Legal Reasons",
|
||||||
"mimetype[application/json].ext": ".json",
|
"mimetype[application/json].ext": ".json",
|
||||||
|
"mimetype[text/markdown].ext": ".md",
|
||||||
|
"mimetype[.jpg]": "image/jpeg",
|
||||||
} {
|
} {
|
||||||
if got := fake(t, f, path); got != want {
|
if got := fake(t, f, path); got != want {
|
||||||
t.Errorf("Fake(%q) = %q, want %q", path, got, want)
|
t.Errorf("Fake(%q) = %q, want %q", path, got, want)
|
||||||
|
|||||||
Reference in New Issue
Block a user