The parity corpus from ROUTER-CORPUS §2, with every expected output captured
from ed47836 rather than written by hand.
Matcher: 24 hand-picked scenarios (precedence, constraint ties, exact versus
catch-all, equal-rank and same-pattern ties with reversed twins, implicit and
explicit HEAD, streaming GETs, canonical Allow, encoding, case, Unicode and
normalization) plus 40 scenarios from a fixed-seed generator
(router-parity-gen-v1, seed 10908). The generated file stores the seed, the
rules and every generated input; the test regenerates and requires a match,
so changing the generator cannot move the baseline. Each scenario runs through
the oracle and the live router and both must equal the capture, compared by
declaration ID, decoded params, implicitHead, ordered Allow, or the
normalization error.
Application level: status, Allow, headers and body through app.fetch and a
Node socket, including HEAD body suppression, 400/404/405 and OPTIONS.
WebSocket, separate from HTTP: first-registered selection, an HTTP route at the
same path not taking the upgrade, and the reserved mesh control path, through
app.upgrade and the Node listener. This freezes one adapter disagreement as
observed: a user @Ws('/__mesh__/control') on an app without mesh is refused by
app.upgrade (1008) and served by the Node listener.
Boot-time rejections: pattern compilation, local ambiguity and mesh splicing
(duplicate exports, same-shape exports, local-over-remote precedence with its
warning, and a remote static outranking a local parameter route).
Refs #109
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
164 lines
3.8 KiB
JSON
164 lines
3.8 KiB
JSON
{
|
|
"revision": "ed47836c9820c47bf4ed5e902d91e019abdb110a",
|
|
"data": [
|
|
{
|
|
"pattern": "/",
|
|
"shape": ""
|
|
},
|
|
{
|
|
"pattern": "/users/:id",
|
|
"shape": "s:users/p"
|
|
},
|
|
{
|
|
"pattern": "/users/:id(\\d+)",
|
|
"shape": "s:users/r:\\d+"
|
|
},
|
|
{
|
|
"pattern": "/files/:rest*",
|
|
"shape": "s:files/c"
|
|
},
|
|
{
|
|
"pattern": "/:rest*",
|
|
"shape": "c"
|
|
},
|
|
{
|
|
"pattern": "/t/",
|
|
"shape": "s:t"
|
|
},
|
|
{
|
|
"pattern": "/café",
|
|
"shape": "s:café"
|
|
},
|
|
{
|
|
"pattern": "/build/:version(\\d{2}\\.\\d{1,2})",
|
|
"shape": "s:build/r:\\d{2}\\.\\d{1,2}"
|
|
},
|
|
{
|
|
"pattern": "/x/:id/:id",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "invalid route pattern '/x/:id/:id': duplicate parameter 'id'"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:id/:rest*/tail",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "invalid route pattern '/x/:id/:rest*/tail': catch-all must be the final segment"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:rest*/:rest*",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "invalid route pattern '/x/:rest*/:rest*': catch-all must be the final segment"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "invalid route pattern '/x/:': invalid parameter name ''"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:1x",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "invalid route pattern '/x/:1x': invalid parameter name '1x'"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x//y",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "invalid route pattern '/x//y': repeated slash"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "x",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "invalid route pattern 'x': pattern must start with '/'"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "invalid route pattern '': pattern must start with '/'"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:id((a+)+)",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "unsafe route constraint: unsupported expression '(a+)+'"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:id((?=a)a)",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "unsafe route constraint: unsupported expression '(?=a)a'"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:id(\\1)",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "unsafe route constraint: unsupported expression '\\1'"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:id(a|b)",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "unsafe route constraint: unsupported expression 'a|b'"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:id(\\d+\\w+)",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "unsafe route constraint: adjacent unbounded quantifiers in '\\d+\\w+'"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:id(\\d{5,2})",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "unsafe route constraint: invalid quantifier '{5,2}'"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:id(\\d{1,4096})",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "unsafe route constraint: invalid quantifier '{1,4096}'"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:id(\\d+",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "invalid route pattern '/x/:id(\\d+': malformed constraint"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:id()",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "unsafe route constraint: expression must contain 1-128 characters"
|
|
}
|
|
},
|
|
{
|
|
"pattern": "/x/:id(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)",
|
|
"error": {
|
|
"name": "Error",
|
|
"message": "unsafe route constraint: expression must contain 1-128 characters"
|
|
}
|
|
}
|
|
]
|
|
}
|