Skip to content

Test RFC 6901 escaped tilde decoding order - #108

Merged
stefankoegl merged 1 commit into
stefankoegl:masterfrom
Muffi7869:test-rfc6901-escape-order
Nov 4, 2026
Merged

stefankoegl merged 1 commit into
stefankoegl:masterfrom
Muffi7869:test-rfc6901-escape-order

Conversation

@Muffi7869

Copy link
Copy Markdown
Contributor

Add a focused specification test for the decoding order in RFC 6901 section 4: ~01 must become the literal member name ~1, not /.

The implementation is already correct. Reversing the two replacements in unescape() still passes the existing 84 tests, but fails this new test. The test checks decoded parts, a round trip, resolution against distinct ~1 and / members, and assignment that leaves the slash member unchanged. No runtime code changes.

Validation on Linux, Python 3.10.12:

  • Full unittest suite: 85 tests passed, also from a fresh clone of the published branch.
  • Reversed-decoding mutation: new test fails as expected.
  • flake8 and git diff --check: passed.
  • Stubtest, Sphinx warnings-as-errors, wheel/sdist build and strict twine checks: passed.

AI assistance was used to prepare and review this test; Claude also reviewed the exact patch. The reported validation above was run locally.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the test-only RFC 6901 decoding-order regression coverage.

No open issues 🎉

What changed in this PR

Adds a focused regression test for RFC 6901 decoding order, ensuring ~01 resolves to the literal member name ~1, not /. Runtime code remains unchanged.

Changes:

  • Verifies decoded pointer parts and round-trip encoding.
  • Checks resolution and assignment against distinct ~1 and / members, ensuring assignment leaves the slash member unchanged.
File Description
tests.py Adds regression coverage for escaped-tilde decoding order.

Review effort: Balanced

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.714%. remained the same — Muffi7869:test-rfc6901-escape-order into stefankoegl:master

@stefankoegl
stefankoegl merged commit a6bacf2 into stefankoegl:master Nov 4, 2026
24 checks passed
@stefankoegl

Copy link
Copy Markdown
Owner

Thanks!

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.

4 participants