Pin the port tie-break on a port where it discriminates, and protocol selection by name
This commit is contained in:
+1
-1
@@ -115,7 +115,7 @@ func TestShippedMiscReferenceData(t *testing.T) {
|
|||||||
"httpmethod.safe": regexp.MustCompile(`^(yes|no)$`),
|
"httpmethod.safe": regexp.MustCompile(`^(yes|no)$`),
|
||||||
"httpmethod.idempotent": regexp.MustCompile(`^(yes|no)$`),
|
"httpmethod.idempotent": regexp.MustCompile(`^(yes|no)$`),
|
||||||
"port": regexp.MustCompile(`^[1-9]\d{0,4}$`),
|
"port": regexp.MustCompile(`^[1-9]\d{0,4}$`),
|
||||||
"port.name": regexp.MustCompile(`^\S+$`),
|
"port.service": regexp.MustCompile(`^\S+$`),
|
||||||
"protocol": regexp.MustCompile(`^\S+( \S+)*$`),
|
"protocol": regexp.MustCompile(`^\S+( \S+)*$`),
|
||||||
"protocol.name": regexp.MustCompile(`\S`),
|
"protocol.name": regexp.MustCompile(`\S`),
|
||||||
"protocol.number": regexp.MustCompile(`^\d{1,3}$`),
|
"protocol.number": regexp.MustCompile(`^\d{1,3}$`),
|
||||||
|
|||||||
+53
-51
@@ -663,57 +663,59 @@ func TestTableOverridesByLayering(t *testing.T) {
|
|||||||
func TestShippedTables(t *testing.T) {
|
func TestShippedTables(t *testing.T) {
|
||||||
f := newGenerator(t, "data/misc", WithSeed(1))
|
f := newGenerator(t, "data/misc", WithSeed(1))
|
||||||
for path, want := range map[string]string{
|
for path, want := range map[string]string{
|
||||||
"territory[SE]": "Sweden",
|
"territory[SE]": "Sweden",
|
||||||
"territory[Sweden].alpha3": "SWE",
|
"territory[Sweden].alpha3": "SWE",
|
||||||
"territory[SE].numeric": "752",
|
"territory[SE].numeric": "752",
|
||||||
"territory[SE].tld": ".se",
|
"territory[SE].tld": ".se",
|
||||||
"territory[SE].calling-code": "46",
|
"territory[SE].calling-code": "46",
|
||||||
"territory[SE].capital": "Stockholm",
|
"territory[SE].capital": "Stockholm",
|
||||||
"territory[SE].currency": "SEK",
|
"territory[SE].currency": "SEK",
|
||||||
"territory[SE].flag": "🇸🇪",
|
"territory[SE].flag": "🇸🇪",
|
||||||
"territory[SE].country": "SE",
|
"territory[SE].country": "SE",
|
||||||
"territory[GL]": "Greenland",
|
"territory[GL]": "Greenland",
|
||||||
"territory[GL].country": "DK",
|
"territory[GL].country": "DK",
|
||||||
"territory[Åland Islands].country": "FI",
|
"territory[Åland Islands].country": "FI",
|
||||||
"currency[SEK].name": "Swedish Krona",
|
"currency[SEK].name": "Swedish Krona",
|
||||||
"currency[SEK].symbol": "kr",
|
"currency[SEK].symbol": "kr",
|
||||||
"currency[SEK].numeric": "752",
|
"currency[SEK].numeric": "752",
|
||||||
"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[sv].code3": "swe",
|
||||||
"language[Swedish].code": "sv",
|
"language[Swedish].code": "sv",
|
||||||
"language[nl]": "Dutch",
|
"language[nl]": "Dutch",
|
||||||
"httpstatus[200]": "200 OK",
|
"httpstatus[200]": "200 OK",
|
||||||
"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",
|
"httpstatus[451].reason": "Unavailable For Legal Reasons",
|
||||||
"httpstatus[500].reason": "Internal Server Error",
|
"httpstatus[500].reason": "Internal Server Error",
|
||||||
"mimetype[application/json].ext": ".json",
|
"mimetype[application/json].ext": ".json",
|
||||||
"mimetype[text/markdown].ext": ".md",
|
"mimetype[text/markdown].ext": ".md",
|
||||||
"mimetype[.jpg]": "image/jpeg",
|
"mimetype[.jpg]": "image/jpeg",
|
||||||
"mimetype[.mov]": "video/quicktime",
|
"mimetype[.mov]": "video/quicktime",
|
||||||
"mimetype[.mp3]": "audio/mpeg",
|
"mimetype[.mp3]": "audio/mpeg",
|
||||||
"mimetype[.mp4]": "video/mp4",
|
"mimetype[.mp4]": "video/mp4",
|
||||||
"mimetype[.ogg]": "audio/ogg",
|
"mimetype[.ogg]": "audio/ogg",
|
||||||
"timezone[Europe/Stockholm]": "Europe/Stockholm",
|
"timezone[Europe/Stockholm]": "Europe/Stockholm",
|
||||||
"timezone[Europe/Stockholm].offset": "+01:00",
|
"timezone[Europe/Stockholm].offset": "+01:00",
|
||||||
"timezone[Asia/Kathmandu].offset": "+05:45",
|
"timezone[Asia/Kathmandu].offset": "+05:45",
|
||||||
"timezone[America/New_York].offset": "-05:00",
|
"timezone[America/New_York].offset": "-05:00",
|
||||||
"territory[SE].timezone": "Europe/Stockholm",
|
"territory[SE].timezone": "Europe/Stockholm",
|
||||||
"httpmethod[GET].safe": "yes",
|
"httpmethod[GET].safe": "yes",
|
||||||
"httpmethod[GET].idempotent": "yes",
|
"httpmethod[GET].idempotent": "yes",
|
||||||
"httpmethod[POST].safe": "no",
|
"httpmethod[POST].safe": "no",
|
||||||
"httpmethod[POST].idempotent": "no",
|
"httpmethod[POST].idempotent": "no",
|
||||||
"httpmethod[PUT].idempotent": "yes",
|
"httpmethod[PUT].idempotent": "yes",
|
||||||
"protocol[TCP].number": "6",
|
"protocol[TCP].number": "6",
|
||||||
"protocol[UDP].number": "17",
|
"protocol[UDP].number": "17",
|
||||||
"protocol[ICMP].name": "Internet Control Message",
|
"protocol[ICMP].name": "Internet Control Message",
|
||||||
"port[443]": "443",
|
"port[443]": "443",
|
||||||
"port[443].name": "https",
|
"port[443].service": "https",
|
||||||
"port[22].name": "ssh",
|
"port[22].service": "ssh",
|
||||||
"port[3306].name": "mysql",
|
"port[3306].service": "mysql",
|
||||||
"territory[NP].timezone.offset": "+05:45",
|
"port[2049].service": "nfs",
|
||||||
|
"protocol[Transmission Control].number": "6",
|
||||||
|
"territory[NP].timezone.offset": "+05:45",
|
||||||
} {
|
} {
|
||||||
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