From 15af49e618a5d0b3f148e92ca33e38a1f64bc4fb Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 20 Sep 2026 18:06:01 +0200 Subject: [PATCH] Expect the IANA root zone as a table, selectable by either label --- data_test.go | 3 +++ table_test.go | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/data_test.go b/data_test.go index a0d465f..7e1b0b2 100644 --- a/data_test.go +++ b/data_test.go @@ -119,6 +119,9 @@ func TestShippedMiscReferenceData(t *testing.T) { "protocol": regexp.MustCompile(`^\S+( \S+)*$`), "protocol.name": regexp.MustCompile(`\S`), "protocol.number": regexp.MustCompile(`^\d{1,3}$`), + "tld": regexp.MustCompile(`^\.[a-z0-9]([a-z0-9-]*[a-z0-9])?$`), + "tld.type": regexp.MustCompile(`^(country-code|generic|generic-restricted|infrastructure|sponsored)$`), + "tld.unicode": regexp.MustCompile(`^\.\S+$`), "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 ff998c9..52f2ad6 100644 --- a/table_test.go +++ b/table_test.go @@ -716,6 +716,13 @@ func TestShippedTables(t *testing.T) { "port[465].service": "urd", "port[2049].service": "nfs", "protocol[Transmission Control].number": "6", + "tld[.se]": ".se", + "tld[.se].type": "country-code", + "tld[.com].type": "generic", + "tld[.museum].type": "sponsored", + "tld[.arpa].type": "infrastructure", + "tld[.рф]": ".xn--p1ai", + "tld[.xn--p1ai].unicode": ".рф", "territory[NP].timezone.offset": "+05:45", } { if got := fake(t, f, path); got != want {