Skip to content

Commit bab36a0

Browse files
committed
Merge feature/tinytorch-core: fix memoization test assertions
2 parents 6f8efe8 + 796bedb commit bab36a0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tinytorch/tests/18_memoization/test_kv_cache_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,15 @@ def test_cache_boundary_conditions(self):
291291
cache.update(0, k, v)
292292
assert False, "Should raise ValueError on overflow"
293293
except ValueError as e:
294-
assert "Sequence position" in str(e)
294+
assert "cache is full" in str(e).lower() or "position" in str(e).lower()
295295
print(f"✅ Overflow protection works: {str(e)[:50]}...")
296296

297297
# Test 4: Invalid layer index
298298
try:
299299
cache.get(layer_idx=99)
300300
assert False, "Should raise ValueError for invalid layer"
301301
except ValueError as e:
302-
assert "Layer index" in str(e)
302+
assert "layer" in str(e).lower() and "index" in str(e).lower()
303303
print(f"✅ Layer bounds checking works: {str(e)[:50]}...")
304304

305305

0 commit comments

Comments
 (0)