Expect IANA's method, protocol and port registries as tables
This commit is contained in:
@@ -111,6 +111,14 @@ func TestShippedMiscReferenceData(t *testing.T) {
|
||||
"timezone.weight": regexp.MustCompile(`^[1-9]\d*$`),
|
||||
"mimetype": regexp.MustCompile(`^[a-z]+/[a-z0-9.+-]+$`),
|
||||
"mimetype.ext": regexp.MustCompile(`^\.[a-z0-9_-]+$`),
|
||||
"httpmethod": regexp.MustCompile(`^[A-Za-z][A-Za-z-]*$`),
|
||||
"httpmethod.safe": regexp.MustCompile(`^(yes|no)$`),
|
||||
"httpmethod.idempotent": regexp.MustCompile(`^(yes|no)$`),
|
||||
"port": regexp.MustCompile(`^[1-9]\d{0,4}$`),
|
||||
"port.name": regexp.MustCompile(`^\S+$`),
|
||||
"protocol": regexp.MustCompile(`^\S+( \S+)*$`),
|
||||
"protocol.name": regexp.MustCompile(`\S`),
|
||||
"protocol.number": regexp.MustCompile(`^\d{1,3}$`),
|
||||
"httpstatus": regexp.MustCompile(`^[1-5]\d{2} \S.*$`),
|
||||
"httpstatus.code": regexp.MustCompile(`^[1-5]\d{2}$`),
|
||||
"useragent": regexp.MustCompile(`^Mozilla/5\.0 .+`),
|
||||
|
||||
@@ -701,6 +701,18 @@ func TestShippedTables(t *testing.T) {
|
||||
"timezone[Asia/Kathmandu].offset": "+05:45",
|
||||
"timezone[America/New_York].offset": "-05:00",
|
||||
"territory[SE].timezone": "Europe/Stockholm",
|
||||
"httpmethod[GET].safe": "yes",
|
||||
"httpmethod[GET].idempotent": "yes",
|
||||
"httpmethod[POST].safe": "no",
|
||||
"httpmethod[POST].idempotent": "no",
|
||||
"httpmethod[PUT].idempotent": "yes",
|
||||
"protocol[TCP].number": "6",
|
||||
"protocol[UDP].number": "17",
|
||||
"protocol[ICMP].name": "Internet Control Message",
|
||||
"port[443]": "443",
|
||||
"port[443].name": "https",
|
||||
"port[22].name": "ssh",
|
||||
"port[3306].name": "mysql",
|
||||
"territory[NP].timezone.offset": "+05:45",
|
||||
} {
|
||||
if got := fake(t, f, path); got != want {
|
||||
|
||||
Reference in New Issue
Block a user