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
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

+169 -169
View File
@@ -14,10 +14,10 @@
13,
1
],
"partial_move": 0.1,
"age": 1,
"partial_move": 0.0,
"age": 0,
"sex": "FEMALE",
"direction": "LEFT"
"direction": "DOWN"
},
{
"id": "2",
@@ -30,10 +30,10 @@
5,
11
],
"partial_move": 0.1,
"age": 1,
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "LEFT"
"direction": "DOWN"
},
{
"id": "3",
@@ -46,10 +46,10 @@
7,
30
],
"partial_move": 0.1,
"age": 1,
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "RIGHT"
"direction": "DOWN"
},
{
"id": "4",
@@ -62,10 +62,10 @@
20,
1
],
"partial_move": 0.1,
"age": 1,
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "LEFT"
"direction": "DOWN"
},
{
"id": "5",
@@ -78,10 +78,10 @@
10,
11
],
"partial_move": 0.1,
"age": 1,
"partial_move": 0.0,
"age": 0,
"sex": "FEMALE",
"direction": "LEFT"
"direction": "DOWN"
}
],
"frame": 0
@@ -94,69 +94,21 @@
"id": "0",
"type": "Female",
"pos": [
7,
12,
1
],
"pos_before": [
8,
13,
1
],
"partial_move": 0.1,
"age": 51,
"partial_move": 0.0,
"age": 0,
"sex": "FEMALE",
"direction": "LEFT"
"direction": "DOWN"
},
{
"id": "2",
"type": "Male",
"pos": [
6,
8
],
"pos_before": [
5,
8
],
"partial_move": 0.1,
"age": 51,
"sex": "MALE",
"direction": "RIGHT"
},
{
"id": "3",
"type": "Male",
"pos": [
13,
30
],
"pos_before": [
12,
30
],
"partial_move": 0.1,
"age": 51,
"sex": "MALE",
"direction": "RIGHT"
},
{
"id": "4",
"type": "Male",
"pos": [
18,
5
],
"pos_before": [
18,
4
],
"partial_move": 0.1,
"age": 51,
"sex": "MALE",
"direction": "DOWN"
},
{
"id": "5",
"type": "Female",
"pos": [
4,
11
@@ -165,10 +117,58 @@
5,
11
],
"partial_move": 0.1,
"age": 51,
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "DOWN"
},
{
"id": "3",
"type": "Male",
"pos": [
8,
30
],
"pos_before": [
7,
30
],
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "DOWN"
},
{
"id": "4",
"type": "Male",
"pos": [
19,
1
],
"pos_before": [
20,
1
],
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "DOWN"
},
{
"id": "5",
"type": "Female",
"pos": [
9,
11
],
"pos_before": [
10,
11
],
"partial_move": 0.0,
"age": 0,
"sex": "FEMALE",
"direction": "LEFT"
"direction": "DOWN"
}
],
"frame": 50
@@ -181,15 +181,15 @@
"id": "0",
"type": "Female",
"pos": [
6,
5
12,
1
],
"pos_before": [
6,
4
13,
1
],
"partial_move": 0.1,
"age": 101,
"partial_move": 0.0,
"age": 0,
"sex": "FEMALE",
"direction": "DOWN"
},
@@ -198,64 +198,64 @@
"type": "Male",
"pos": [
4,
5
11
],
"pos_before": [
5,
5
11
],
"partial_move": 0.1,
"age": 101,
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "LEFT"
"direction": "DOWN"
},
{
"id": "3",
"type": "Male",
"pos": [
18,
8,
30
],
"pos_before": [
17,
7,
30
],
"partial_move": 0.1,
"age": 101,
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "RIGHT"
"direction": "DOWN"
},
{
"id": "4",
"type": "Male",
"pos": [
18,
8
19,
1
],
"pos_before": [
19,
8
20,
1
],
"partial_move": 0.1,
"age": 101,
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "LEFT"
"direction": "DOWN"
},
{
"id": "5",
"type": "Female",
"pos": [
3,
15
9,
11
],
"pos_before": [
4,
15
10,
11
],
"partial_move": 0.1,
"age": 101,
"partial_move": 0.0,
"age": 0,
"sex": "FEMALE",
"direction": "LEFT"
"direction": "DOWN"
}
],
"frame": 100
@@ -268,15 +268,15 @@
"id": "0",
"type": "Female",
"pos": [
10,
6
12,
1
],
"pos_before": [
10,
5
13,
1
],
"partial_move": 0.1,
"age": 151,
"partial_move": 0.0,
"age": 0,
"sex": "FEMALE",
"direction": "DOWN"
},
@@ -284,65 +284,65 @@
"id": "2",
"type": "Male",
"pos": [
1,
3
4,
11
],
"pos_before": [
1,
4
5,
11
],
"partial_move": 0.1,
"age": 151,
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "UP"
"direction": "DOWN"
},
{
"id": "3",
"type": "Male",
"pos": [
22,
29
],
"pos_before": [
22,
8,
30
],
"partial_move": 0.1,
"age": 151,
"pos_before": [
7,
30
],
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "UP"
"direction": "DOWN"
},
{
"id": "4",
"type": "Male",
"pos": [
15,
8
19,
1
],
"pos_before": [
16,
8
20,
1
],
"partial_move": 0.1,
"age": 151,
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "LEFT"
"direction": "DOWN"
},
{
"id": "5",
"type": "Female",
"pos": [
4,
15
9,
11
],
"pos_before": [
3,
15
10,
11
],
"partial_move": 0.1,
"age": 151,
"partial_move": 0.0,
"age": 0,
"sex": "FEMALE",
"direction": "RIGHT"
"direction": "DOWN"
}
],
"frame": 150
@@ -355,63 +355,63 @@
"id": "0",
"type": "Female",
"pos": [
11,
7
12,
1
],
"pos_before": [
11,
8
13,
1
],
"partial_move": 0.95,
"age": 200,
"partial_move": 0.0,
"age": 0,
"sex": "FEMALE",
"direction": "UP"
"direction": "DOWN"
},
{
"id": "2",
"type": "Male",
"pos": [
3,
1
4,
11
],
"pos_before": [
2,
1
5,
11
],
"partial_move": 0.95,
"age": 200,
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "RIGHT"
"direction": "DOWN"
},
{
"id": "3",
"type": "Male",
"pos": [
23,
26
8,
30
],
"pos_before": [
22,
26
7,
30
],
"partial_move": 0.95,
"age": 200,
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "RIGHT"
"direction": "DOWN"
},
{
"id": "4",
"type": "Male",
"pos": [
13,
8
19,
1
],
"pos_before": [
13,
7
20,
1
],
"partial_move": 0.95,
"age": 200,
"partial_move": 0.0,
"age": 0,
"sex": "MALE",
"direction": "DOWN"
},
@@ -419,17 +419,17 @@
"id": "5",
"type": "Female",
"pos": [
4,
9,
11
],
"pos_before": [
4,
12
10,
11
],
"partial_move": 0.95,
"age": 200,
"partial_move": 0.0,
"age": 0,
"sex": "FEMALE",
"direction": "UP"
"direction": "DOWN"
}
],
"frame": 199