Report unread bytes and round-trip through JSON text in test czones

The CZone test now flags any record the parser does not read to the
end and passes the JSON through json.dumps/loads, as unpack and pack
do, before rebuilding the binary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-24 11:04:53 -04:00
1 parent 876484947c
commit c9d1e4ca24
1 file changed
+4 -1
+4 -1
View File
@@ -295,7 +295,10 @@ def test_czones():
arc_out = ArcZone()
arc_in.load_binary(in_stream)
parsed = arc_in.save_json()
unread = len(data) - in_stream.buffer.tell()
if unread:
print(res_id, 'unread bytes:', unread)
parsed = json.loads(json.dumps(arc_in.save_json()))
arc_out.load_json(parsed)
arc_out.save_binary(out_stream)
try: