Skip to content

Commit aed1f3d

Browse files
valentingmoz-wptsync-bot
authored andcommitted
Add test for urlpattern with x in path
Differential Revision: https://phabricator.services.mozilla.com/D271360 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1998271 gecko-commit: 488e5cca7a4d9e4081f1a07d19d799143df46841 gecko-reviewers: necko-reviewers, jesup
1 parent ce00097 commit aed1f3d

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

urlpattern/resources/urlpatterntestdata.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,5 +3033,80 @@
30333033
"hostname": { "input": "example.com", "groups": {} },
30343034
"pathname": { "input": "/", "groups": { "0": "/" } }
30353035
}
3036+
},
3037+
{
3038+
"pattern": ["https://www.example.com/*"],
3039+
"inputs": ["https://www.example.com/x"],
3040+
"exactly_empty_components": ["port"],
3041+
"expected_obj": {
3042+
"protocol": "https",
3043+
"hostname": "www.example.com",
3044+
"pathname": "/*"
3045+
},
3046+
"expected_match": {
3047+
"protocol": { "input": "https", "groups": {} },
3048+
"hostname": { "input": "www.example.com", "groups": {} },
3049+
"pathname": { "input": "/x", "groups": { "0": "x" } }
3050+
}
3051+
},
3052+
{
3053+
"pattern": ["https://www.example.com/*"],
3054+
"inputs": ["https://www.example.com/xyz"],
3055+
"exactly_empty_components": ["port"],
3056+
"expected_obj": {
3057+
"protocol": "https",
3058+
"hostname": "www.example.com",
3059+
"pathname": "/*"
3060+
},
3061+
"expected_match": {
3062+
"protocol": { "input": "https", "groups": {} },
3063+
"hostname": { "input": "www.example.com", "groups": {} },
3064+
"pathname": { "input": "/xyz", "groups": { "0": "xyz" } }
3065+
}
3066+
},
3067+
{
3068+
"pattern": ["https://www.example.com/*"],
3069+
"inputs": ["https://www.example.com/example"],
3070+
"exactly_empty_components": ["port"],
3071+
"expected_obj": {
3072+
"protocol": "https",
3073+
"hostname": "www.example.com",
3074+
"pathname": "/*"
3075+
},
3076+
"expected_match": {
3077+
"protocol": { "input": "https", "groups": {} },
3078+
"hostname": { "input": "www.example.com", "groups": {} },
3079+
"pathname": { "input": "/example", "groups": { "0": "example" } }
3080+
}
3081+
},
3082+
{
3083+
"pattern": ["https://www.example.com/*"],
3084+
"inputs": ["https://www.example.com/text"],
3085+
"exactly_empty_components": ["port"],
3086+
"expected_obj": {
3087+
"protocol": "https",
3088+
"hostname": "www.example.com",
3089+
"pathname": "/*"
3090+
},
3091+
"expected_match": {
3092+
"protocol": { "input": "https", "groups": {} },
3093+
"hostname": { "input": "www.example.com", "groups": {} },
3094+
"pathname": { "input": "/text", "groups": { "0": "text" } }
3095+
}
3096+
},
3097+
{
3098+
"pattern": ["https://www.example.com/*"],
3099+
"inputs": ["https://www.example.com/path/with/x"],
3100+
"exactly_empty_components": ["port"],
3101+
"expected_obj": {
3102+
"protocol": "https",
3103+
"hostname": "www.example.com",
3104+
"pathname": "/*"
3105+
},
3106+
"expected_match": {
3107+
"protocol": { "input": "https", "groups": {} },
3108+
"hostname": { "input": "www.example.com", "groups": {} },
3109+
"pathname": { "input": "/path/with/x", "groups": { "0": "path/with/x" } }
3110+
}
30363111
}
30373112
]

0 commit comments

Comments
 (0)