mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-03-08 23:03:55 -05:00
fix: update memoization test assertions for new error message format
Updated test assertions to use case-insensitive matching for the new 3-part educational error messages.
This commit is contained in:
@@ -291,7 +291,7 @@ class TestKVCacheIntegration:
|
||||
cache.update(0, k, v)
|
||||
assert False, "Should raise ValueError on overflow"
|
||||
except ValueError as e:
|
||||
assert "Sequence position" in str(e)
|
||||
assert "cache is full" in str(e).lower() or "position" in str(e).lower()
|
||||
print(f"✅ Overflow protection works: {str(e)[:50]}...")
|
||||
|
||||
# Test 4: Invalid layer index
|
||||
@@ -299,7 +299,7 @@ class TestKVCacheIntegration:
|
||||
cache.get(layer_idx=99)
|
||||
assert False, "Should raise ValueError for invalid layer"
|
||||
except ValueError as e:
|
||||
assert "Layer index" in str(e)
|
||||
assert "layer" in str(e).lower() and "index" in str(e).lower()
|
||||
print(f"✅ Layer bounds checking works: {str(e)[:50]}...")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user