MCPcopy Create free account
hub / github.com/QuipNetwork/xquad / test_bytecode_decode_bad_version

Function test_bytecode_decode_bad_version

xqvm_py/tests/test_program.py:87–98  ·  view source on GitHub ↗

Unsupported version byte raises ValueError.

()

Source from the content-addressed store, hash-verified

85
86
87def 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
101def test_bytecode_decode_length_mismatch():

Callers

nothing calls this directly

Calls 2

program_from_bytecodeFunction · 0.90
bytesFunction · 0.85

Tested by

no test coverage detected