Skip to content

Commit 68ffecf

Browse files
committed
fix invalid urlpattern test validating hostname
1 parent b2eb421 commit 68ffecf

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

urlpattern/resources/urlpatterntestdata.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,15 +2370,24 @@
23702370
},
23712371
{
23722372
"pattern": [{ "hostname": "bad#hostname" }],
2373-
"expected_obj": "error"
2373+
"exactly_empty_components": ["port"],
2374+
"expected_match": {
2375+
"hostname": { "input": "bad", "groups": {} }
2376+
}
23742377
},
23752378
{
23762379
"pattern": [{ "hostname": "bad%hostname" }],
2377-
"expected_obj": "error"
2380+
"exactly_empty_components": ["port"],
2381+
"expected_match": {
2382+
"hostname": { "input": "bad%hostname", "groups": {} }
2383+
}
23782384
},
23792385
{
23802386
"pattern": [{ "hostname": "bad/hostname" }],
2381-
"expected_obj": "error"
2387+
"exactly_empty_components": ["port"],
2388+
"expected_match": {
2389+
"hostname": { "input": "bad", "groups": {} }
2390+
}
23822391
},
23832392
{
23842393
"pattern": [{ "hostname": "bad\\:hostname" }],
@@ -2422,7 +2431,10 @@
24222431
},
24232432
{
24242433
"pattern": [{ "hostname": "bad\nhostname" }],
2425-
"expected_obj": "error"
2434+
"exactly_empty_components": ["port"],
2435+
"expected_match": {
2436+
"hostname": { "input": "badhostname", "groups": {} }
2437+
}
24262438
},
24272439
{
24282440
"pattern": [{ "hostname": "bad\rhostname" }],

0 commit comments

Comments
 (0)