test: add exhaustive uri format cases across drafts#895
Conversation
f4660d1 to
9407fb8
Compare
jviotti
left a comment
There was a problem hiding this comment.
I spent some time today on this. Lots of tests, but as far as I could tell, all of them are RFC compliant. I couldn't catch anything non compliant, though I would love reviews from other TSC members knowledgeable in URIs, like @jdesrosiers (as you also have your own URI implementation).
Given the low coverage we have on these things, I think this is a great addition, and we can always continue incrementally polishing it with more edge cases.
|
Thanks @jviotti Will keep looking for more edge cases and open up PR as things surface. Also starting to work through the other formats simultaneously . |
jdesrosiers
left a comment
There was a problem hiding this comment.
I'm not sure what to do with this. It's much too large to fully review. I'm sure there's a lot of good tests in there, but I'm not convinced that they are all unique tests that each provide unique value.
The best I could do is run the tests against my implementation and analyze the results. That didn't find anything wrong, so I'll approve, but I'm still anxious about pushing the merge button on something like this.
This PR expands the
uriformat test suite across all drafts. The expansion provides complete coverage of RFC 3986 ABNF and prose constraints. Every test was traced directly against RFC 3986 , not derived from implementation output.Technical Coverage Details
The new cases cover every structural dimension of the grammar:
%x41-5A / %x61-7A), rejection of invalid characters (~,=,/, space),%-encoding forbidden in scheme, empty-before-colon, and missing colon.%, incomplete triplets, and%-encoding forbidden in port.@split (guards against last-@scanning bugs), slash and?boundary tests.::form; IPvFuture with uppercaseV; rejection of two::, >4 hex digits in h16, wrong group counts, misformed IPvFuture, and non-ASCII in host.*DIGIT- empty port, leading zeros, no upper bound, rejection of+,-, space,., alpha characters, pct-encoded digits, and Unicode decimal digits.{,},^,`,|,\,",<,>), control characters, and non-ASCII; dot and double-dot segments./+?; at-sign valid in both; rejection of[,],{,^, space, and second#in fragment; pct-encoding valid/invalid; empty and absent forms.//) and path-only relative-refs correctly rejected ,format: "uri"requires an absolute URI with scheme.Standards & Traceability
Following the style of
ipv4.json, non-obvious tests carry acommentfield mentioning the relevant RFC 3986 section and ABNF production.Triangulation note: Spot-checked against ajv-formats and python-jsonschema-format. All mismatches reflect implementation gaps against strict RFC 3986 ABNF, not errors in the test vectors.
Feedback appreciated @jviotti @jdesrosiers @karenetheridge