Skip to content

test: pin Uri port and path edge-case behavior - #61

Merged
OmarAlJarrah merged 2 commits into
mainfrom
test/pin-uri-port-and-path-edge-cases
Jul 13, 2026
Merged

test: pin Uri port and path edge-case behavior#61
OmarAlJarrah merged 2 commits into
mainfrom
test/pin-uri-port-and-path-edge-cases

Conversation

@OmarAlJarrah

Copy link
Copy Markdown
Member

Summary

  • Add a regression test pinning that Uri.parse drops a leading zero on the port when reserializing (http://h:007/ round-trips as http://h:7/, since port is stored as Int?).
  • Add regression tests pinning that raw non-grammar characters (space, <, {/}) in the path are preserved verbatim rather than rejected or percent-encoded, per the Uri profile's RFC 3986 Appendix B non-validating-recognizer behavior.
  • Tighten the RFC 3987 row in the README standards table to describe what kuri actually does: a one-way Iri mapping (RFC 3987 §3.1/§3.2), not a validating parser (no §4 bidi or repertoire checks).

Test plan

  • ./gradlew :kuri:jvmTest :kuri:ktlintCheck :kuri:detekt :kuri:apiCheck — all four pass (BUILD SUCCESSFUL)

Uri.parse currently drops a leading zero on the port when reserializing
(port is stored as Int?, so "007" round-trips as "7") and preserves raw
non-grammar characters like spaces, angle brackets, and curly braces
verbatim in the path, per RFC 3986 Appendix B's non-validating-recognizer
posture. Both are intentional, but neither had a regression test, so a
future change could silently alter either behavior. Add tests pinning
both.

Also tighten the RFC 3987 row in the README standards table: kuri does
a one-way IRI-to-URI mapping, not full IRI validation (no bidi or
repertoire checks), and the table wording was overstating the scope.
Round out the angle-bracket and curly-brace path pinning tests with the
same uriString round-trip assertion the space test already has, and
shrink the oversized RFC 3987 table cell back to the sibling rows'
width, moving the IRI-mapping caveat into a footnote below the table.
@OmarAlJarrah
OmarAlJarrah merged commit b0b3a8c into main Jul 13, 2026
11 checks passed
@OmarAlJarrah
OmarAlJarrah deleted the test/pin-uri-port-and-path-edge-cases branch July 13, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant