Skip to content

Commit b8161ce

Browse files
fix: correct BOOLEAN test to use uint64 matching actual implementation
The test docstring said "int64 (putInt64/getInt64)" and used decode_int64, but the implementation uses encode_uint64/decode_uint64. Updated test name, docstring, and assertions to use decode_uint64, matching the C server's uint64_t boolean encoding. Closes #126 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fc7eeeb commit b8161ce

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

tests/test_types.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,20 +315,19 @@ def test_encode_none(self) -> None:
315315
def test_encode_bool_true(self) -> None:
316316
encoded, vtype = encode_value(True)
317317
assert vtype == ValueType.BOOLEAN
318-
assert decode_int64(encoded) == 1
318+
assert decode_uint64(encoded) == 1
319319

320320
def test_encode_bool_false(self) -> None:
321321
encoded, vtype = encode_value(False)
322322
assert vtype == ValueType.BOOLEAN
323-
assert decode_int64(encoded) == 0
323+
assert decode_uint64(encoded) == 0
324324

325-
def test_boolean_uses_int64_encoding(self) -> None:
326-
"""Go reference encodes BOOLEAN as int64 (putInt64/getInt64)."""
325+
def test_boolean_uses_uint64_encoding(self) -> None:
326+
"""BOOLEAN encodes as uint64 (0 or 1), matching C server's uint64_t."""
327327
encoded_true, _ = encode_value(True, ValueType.BOOLEAN)
328328
encoded_false, _ = encode_value(False, ValueType.BOOLEAN)
329-
# Must be decodable as int64 (signed), matching Go's putInt64
330-
assert decode_int64(encoded_true) == 1
331-
assert decode_int64(encoded_false) == 0
329+
assert decode_uint64(encoded_true) == 1
330+
assert decode_uint64(encoded_false) == 0
332331

333332
def test_boolean_explicit_rejects_non_bool_non_int(self) -> None:
334333
"""encode_value with explicit BOOLEAN should reject non-bool/int types."""

0 commit comments

Comments
 (0)