From 710b6b0261ccb35df66d51e968a0939f27991e6c Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 18 Sep 2026 23:33:52 +0200 Subject: [PATCH] Expect misc.timezone weighted so a territory's populous zones win the draw --- data_test.go | 1 + table_test.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/data_test.go b/data_test.go index 7afffbe..07ca6d9 100644 --- a/data_test.go +++ b/data_test.go @@ -108,6 +108,7 @@ func TestShippedMiscReferenceData(t *testing.T) { "timezone": regexp.MustCompile(`^[A-Za-z]+(/[A-Za-z0-9_+-]+)+$`), "timezone.offset": regexp.MustCompile(`^[+-](0\d|1[0-4]):[0-5]\d$`), "timezone.territory": regexp.MustCompile(`^[A-Z]{2}$`), + "timezone.weight": regexp.MustCompile(`^[1-9]\d*$`), "mimetype": regexp.MustCompile(`^[a-z]+/[a-z0-9.+-]+$`), "mimetype.ext": regexp.MustCompile(`^\.[a-z0-9_-]+$`), "httpstatus": regexp.MustCompile(`^[1-5]\d{2} \S.*$`), diff --git a/table_test.go b/table_test.go index 91f8049..9cf0326 100644 --- a/table_test.go +++ b/table_test.go @@ -738,6 +738,13 @@ func TestShippedTables(t *testing.T) { t.Fatalf("%q: a territory and a timezone in one render disagree on the territory", got) } } + zones := map[string]int{} + for i := 0; i < 2000; i++ { + zones[fake(t, f, "territory[US].timezone")]++ + } + if peopled := zones["America/New_York"] + zones["America/Chicago"] + zones["America/Los_Angeles"] + zones["America/Denver"]; peopled < 1600 { + t.Fatalf("the four zones most Americans live in take %d of 2000 US draws, want the population weight to favour them", peopled) + } } // TestEveryTerritoryNamesAShippedCountry proves what no parent can: the sovereign a