Unsupported version byte raises ValueError.
()
| 85 | |
| 86 | |
| 87 | def test_bytecode_decode_bad_version(): |
| 88 | """Unsupported version byte raises ValueError.""" |
| 89 | import struct |
| 90 | import zlib |
| 91 | |
| 92 | import pytest |
| 93 | |
| 94 | code = b"\xff" |
| 95 | crc = zlib.crc32(code) & 0xFFFF_FFFF |
| 96 | bad_version = b"XQBC" + bytes([99, 0, 0]) + struct.pack(">II", len(code), crc) + code |
| 97 | with pytest.raises(ValueError, match="unsupported XQBC version 99"): |
| 98 | program_from_bytecode(bad_version) |
| 99 | |
| 100 | |
| 101 | def test_bytecode_decode_length_mismatch(): |
nothing calls this directly
no test coverage detected