Skip to content

test: add malformed parser coverage for migration snapshots#401

Merged
Baskarayelu merged 2 commits intoRemitwise-Org:mainfrom
emperorsixpacks:test/migration-malformed-parser-cases
Mar 28, 2026
Merged

test: add malformed parser coverage for migration snapshots#401
Baskarayelu merged 2 commits intoRemitwise-Org:mainfrom
emperorsixpacks:test/migration-malformed-parser-cases

Conversation

@emperorsixpacks
Copy link
Copy Markdown
Contributor

Fixes #321

Summary

Adds comprehensive parser-level tests for malformed JSON and binary snapshots in data_migration/src/lib.rs.

Test Coverage Added (17 new tests)

Malformed JSON

  • Empty bytes, random bytes, truncated JSON, schema mismatch, incompatible/future version, tampered checksum, null bytes, array root

Malformed Binary (bincode)

  • Empty bytes, random bytes, truncated binary, bit-flip, incompatible version, tampered checksum, all-zero bytes

Cross-format confusion

  • JSON bytes fed to binary importer
  • Binary bytes fed to JSON importer

Test Results: 25 passed, 0 failed

Security Notes

  • All error paths return typed MigrationError variants — no panics
  • Truncation, invalid encoding, and schema mismatch are all covered

@Baskarayelu Baskarayelu merged commit 0ddb3f6 into Remitwise-Org:main Mar 28, 2026
2 of 3 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.

Add malformed JSON and binary snapshot parser tests

2 participants