diff --git a/urlpattern/resources/urlpatterntestdata.json b/urlpattern/resources/urlpatterntestdata.json index 058079bb6d17ac..03e5606368ce52 100644 --- a/urlpattern/resources/urlpatterntestdata.json +++ b/urlpattern/resources/urlpatterntestdata.json @@ -1145,6 +1145,14 @@ { "pattern": [{ "protocol": "http", "port": "80 " }], "inputs": [{ "protocol": "http", "port": "80" }], + "exactly_empty_components": ["port"], + "expected_match": { + "protocol": { "input": "http", "groups": {} } + } + }, + { + "pattern": [{ "protocol": "http", "port": "100000" }], + "inputs": [{ "protocol": "http", "port": "100000" }], "expected_obj": "error" }, { @@ -2367,15 +2375,24 @@ }, { "pattern": [{ "hostname": "bad#hostname" }], - "expected_obj": "error" + "exactly_empty_components": ["port"], + "expected_match": { + "hostname": { "input": "bad", "groups": {} } + } }, { "pattern": [{ "hostname": "bad%hostname" }], - "expected_obj": "error" + "exactly_empty_components": ["port"], + "expected_match": { + "hostname": { "input": "bad%hostname", "groups": {} } + } }, { "pattern": [{ "hostname": "bad/hostname" }], - "expected_obj": "error" + "exactly_empty_components": ["port"], + "expected_match": { + "hostname": { "input": "bad", "groups": {} } + } }, { "pattern": [{ "hostname": "bad\\:hostname" }], @@ -2419,15 +2436,24 @@ }, { "pattern": [{ "hostname": "bad\nhostname" }], - "expected_obj": "error" + "exactly_empty_components": ["port"], + "expected_match": { + "hostname": { "input": "badhostname", "groups": {} } + } }, { "pattern": [{ "hostname": "bad\rhostname" }], - "expected_obj": "error" + "exactly_empty_components": ["port"], + "expected_match": { + "hostname": { "input": "badhostname", "groups": {} } + } }, { "pattern": [{ "hostname": "bad\thostname" }], - "expected_obj": "error" + "exactly_empty_components": ["port"], + "expected_match": { + "hostname": { "input": "badhostname", "groups": {} } + } }, { "pattern": [{}],