Skip to content

Commit 153c3e9

Browse files
committed
fix invalid urlpattern test validating hostname
1 parent b2eb421 commit 153c3e9

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

urlpattern/resources/urlpatterntestdata.json

Lines changed: 24 additions & 6 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,15 +2431,24 @@
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" }],
2429-
"expected_obj": "error"
2441+
"exactly_empty_components": ["port"],
2442+
"expected_match": {
2443+
"hostname": { "input": "badhostname", "groups": {} }
2444+
}
24302445
},
24312446
{
24322447
"pattern": [{ "hostname": "bad\thostname" }],
2433-
"expected_obj": "error"
2448+
"exactly_empty_components": ["port"],
2449+
"expected_match": {
2450+
"hostname": { "input": "badhostname", "groups": {} }
2451+
}
24342452
},
24352453
{
24362454
"pattern": [{}],

0 commit comments

Comments
 (0)