|
1167 | 1167 | {
|
1168 | 1168 | "pattern": [{ "protocol": "http", "port": "80 " }],
|
1169 | 1169 | "inputs": [{ "protocol": "http", "port": "80" }],
|
1170 |
| - "exactly_empty_components": ["port"], |
1171 |
| - "expected_match": { |
1172 |
| - "protocol": { "input": "http", "groups": {} } |
1173 |
| - } |
| 1170 | + "expected_obj": { |
| 1171 | + "protocol": "http", |
| 1172 | + "port": "80" |
| 1173 | + }, |
| 1174 | + "expected_match": null |
1174 | 1175 | },
|
1175 | 1176 | {
|
1176 | 1177 | "pattern": [{ "protocol": "http", "port": "100000" }],
|
|
1194 | 1195 | "port": { "input": "80", "groups": {}}
|
1195 | 1196 | }
|
1196 | 1197 | },
|
| 1198 | + { |
| 1199 | + "pattern": [{ "port": "80" }], |
| 1200 | + "inputs": [{ "port": "8\t0" }], |
| 1201 | + "expected_match": { |
| 1202 | + "port": { "input": "80", "groups": {}} |
| 1203 | + } |
| 1204 | + }, |
| 1205 | + { |
| 1206 | + "pattern": [{ "port": "80" }], |
| 1207 | + "inputs": [{ "port": "80x" }], |
| 1208 | + "expected_match": { |
| 1209 | + "port": { "input": "80", "groups": {}} |
| 1210 | + } |
| 1211 | + }, |
| 1212 | + { |
| 1213 | + "pattern": [{ "port": "80" }], |
| 1214 | + "inputs": [{ "port": "80?x" }], |
| 1215 | + "expected_match": { |
| 1216 | + "port": { "input": "80", "groups": {}} |
| 1217 | + } |
| 1218 | + }, |
| 1219 | + { |
| 1220 | + "pattern": [{ "port": "80" }], |
| 1221 | + "inputs": [{ "port": "80\\x" }], |
| 1222 | + "expected_match": { |
| 1223 | + "port": { "input": "80", "groups": {}} |
| 1224 | + } |
| 1225 | + }, |
1197 | 1226 | {
|
1198 | 1227 | "pattern": [{ "port": "(.*)" }],
|
1199 | 1228 | "inputs": [{ "port": "invalid80" }],
|
|
1832 | 1861 | "pathname": { "input": "/foo", "groups": {} }
|
1833 | 1862 | }
|
1834 | 1863 | },
|
| 1864 | + { |
| 1865 | + "pattern": [ "https://{sub.}?example{.com/}foo" ], |
| 1866 | + "inputs": [ "https://example.com/foo" ], |
| 1867 | + "exactly_empty_components": [ "port" ], |
| 1868 | + "expected_obj": { |
| 1869 | + "protocol": "https", |
| 1870 | + "hostname": "{sub.}?example.com", |
| 1871 | + "pathname": "*" |
| 1872 | + }, |
| 1873 | + "expected_match": { |
| 1874 | + "protocol": { "input": "https", "groups": {} }, |
| 1875 | + "hostname": { "input": "example.com", "groups": {} }, |
| 1876 | + "pathname": { "input": "/foo", "groups": { "0": "/foo" } } |
| 1877 | + } |
| 1878 | + }, |
1835 | 1879 | {
|
1836 | 1880 | "pattern": [ "{https://}example.com/foo" ],
|
1837 | 1881 | "inputs": [ "https://example.com/foo" ],
|
|
0 commit comments