Skip to content

test: cover parse case edge cases - #50

Merged
shuv-amp merged 1 commit into
mainfrom
test/parse-case-regressions
Sep 19, 2026
Merged

shuv-amp merged 1 commit into
mainfrom
test/parse-case-regressions

Conversation

@laxmanacharya8

Copy link
Copy Markdown
Collaborator

Problem

The case parser was only exercised through successful command-line parses of the two example vectors. Parser rejection behavior, explicit input formats, and v2 serialization stability did not have focused regression coverage.

Root Cause

make check-scripts invoked parse_case.py for valid fixtures but did not run assertions over malformed inputs or parser helper behavior.

Change Summary

  • add a focused parse_case_smoke.py suite
  • cover valid v1/v2 fixtures and a lossless v2 serialize/parse round trip
  • cover empty input, unknown versions, trailing bytes, unsupported flags, and inconsistent recipient flags
  • cover automatic hex decoding, forced binary reads, and invalid hex rejection
  • run the smoke suite from make check-scripts and document it

Testing

  • python3 scripts/parse_case_smoke.py — passed
  • python3 -m py_compile scripts/parse_case_smoke.py — passed
  • make check-claims check-comments PYTHON=python3 — passed
  • git diff --check — passed
  • make check-scripts — new parser smoke passed; the existing C++ worker smoke could not compile locally because secp256k1.h is not installed

Primary Sources

  • Existing v1 and v2 fixtures under tests/vectors/
  • Existing parser contract in scripts/parse_case.py

Release Impact

Test-only change; no runtime or release behavior changes.

Checklist

  • I reproduced the issue or explained the deterministic correctness argument.
  • I added or updated tests where appropriate.
  • I listed the exact commands I ran.
  • I kept changes deterministic.
  • I updated documentation when behavior changed.
  • I did not describe outcomes beyond the evidence in this patch.

@shuv-amp

Copy link
Copy Markdown
Owner

ACK

Coverage looks right.

@shuv-amp
shuv-amp merged commit dd16620 into main Sep 19, 2026
10 checks passed
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.

2 participants