test: Add DoomSystem unit tests (#488)#499
Merged
PipFoweraker merged 2 commits intomainfrom Dec 19, 2025
Merged
Conversation
Add comprehensive unit tests for the DoomSystem class including: - Doom clamping tests (0-100 bounds) - calculate_doom_change() structure and behavior tests - apply_doom_modifier() and set_doom_multiplier() tests - Momentum system capping tests - Status and trend getter tests - Event doom tracking tests - Serialization/deserialization tests Total: 28 test cases covering core doom mechanics. Follows pattern from test_game_state.gd. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixes two bugs in productivity/doom calculation: 1. game_state.gd: get_unmanaged_count() now uses researchers array - Previously only used legacy counts (safety_researchers, etc.) - Now checks researchers.size() first, falls back to legacy counts - Ensures consistency with individual researcher system 2. doom_system.gd: Fixed double-counting in _calculate_unproductive_doom() - Bug: (total_staff - productive) + unmanaged double-counted unmanaged - Fix: total_unproductive = total_staff - productive (correct formula) - Also updated to use researchers array when available Added 8 new test cases: - 5 tests in test_doom_system.gd for unproductive doom scenarios - 3 tests in test_game_state.gd for get_unmanaged_count() 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses two priority issues from the 48-hour sprint:
Issue #488: DoomSystem Unit Tests
calculate_doom_change()structure and behaviorapply_doom_modifier()andset_doom_multiplier()functionalityIssue #424: Unmanaged Employee Productivity Fix
get_unmanaged_count()to use researchers array when available_calculate_unproductive_doom()get_unmanaged_count()in test_game_state.gdTest plan
test_game_state.gdNotes
Closes #488
Closes #424
🤖 Generated with Claude Code