Add comprehensive test suite for game mechanics and level handling

- Introduced `test_final_level_flow.py` to validate final level transitions and game end scenarios.
- Created `test_game_over_flow.py` to ensure game over conditions trigger correctly based on rat counts.
- Implemented `test_keybindings.py` to verify keybinding configurations and their context-specific actions.
- Developed `test_level_editor.py` to assess level editor functionalities and layout computations.
- Added `test_level_io.py` for testing level data serialization and deserialization.
- Established `test_loop_logic_parity.py` to ensure consistent game state across multiple simulation runs.
- Created `test_non_regression.py` to simulate game behavior and capture states for future verification.
- Implemented `test_verify.py` to compare current game states against a golden master for regression detection.
This commit is contained in:
2026-05-19 22:18:43 +02:00
parent 486cd6b7c5
commit c7ed24483d
53 changed files with 10169 additions and 3886 deletions
+3 -6
View File
@@ -1,4 +1,5 @@
from .unit import Unit
from .unit import Unit, UnitType
from engine.collision_system import CollisionLayer
import random
import uuid
@@ -6,10 +7,6 @@ import uuid
AGE_THRESHOLD = 90
from .unit import Unit
from engine.collision_system import CollisionLayer
class Point(Unit):
"""
Represents a collectible point in the game.
@@ -17,7 +14,7 @@ class Point(Unit):
"""
def __init__(self, game, position=(0,0), id=None, value=10):
super().__init__(game, position, id, collision_layer=CollisionLayer.POINT)
super().__init__(game, position, id, collision_layer=CollisionLayer.POINT, unit_type=UnitType.POINT)
self.value = value
self.speed = 1 # Points don't move but need speed for draw timing