🎨 Auto-format GDScript code

Automated formatting applied by tools/run_development.py

🤖 Generated by Gitea Actions
Workflow: Continuous Integration
Run: http://server:3000/nett00n/skelly/actions/runs/90
This commit is contained in:
Gitea Actions
2025-10-01 11:05:19 +00:00
parent 3b8da89ad5
commit 1f1c394587
28 changed files with 655 additions and 1945 deletions

View File

@@ -57,9 +57,7 @@ func test_basic_functionality():
# Test that GameManager has expected properties
TestHelperClass.assert_has_properties(
game_manager,
["pending_gameplay_mode", "is_changing_scene"],
"GameManager properties"
game_manager, ["pending_gameplay_mode", "is_changing_scene"], "GameManager properties"
)
# Test that GameManager has expected methods
@@ -72,19 +70,13 @@ func test_basic_functionality():
"save_game",
"exit_to_main_menu"
]
TestHelperClass.assert_has_methods(
game_manager, expected_methods, "GameManager methods"
)
TestHelperClass.assert_has_methods(game_manager, expected_methods, "GameManager methods")
# Test initial state
TestHelperClass.assert_equal(
"match3",
game_manager.pending_gameplay_mode,
"Default pending gameplay mode"
)
TestHelperClass.assert_false(
game_manager.is_changing_scene, "Initial scene change flag"
"match3", game_manager.pending_gameplay_mode, "Default pending gameplay mode"
)
TestHelperClass.assert_false(game_manager.is_changing_scene, "Initial scene change flag")
func test_scene_constants():
@@ -105,23 +97,15 @@ func test_scene_constants():
TestHelperClass.assert_true(
game_path.begins_with("res://"), "Game scene path uses res:// protocol"
)
TestHelperClass.assert_true(
game_path.ends_with(".tscn"), "Game scene path has .tscn extension"
)
TestHelperClass.assert_true(game_path.ends_with(".tscn"), "Game scene path has .tscn extension")
TestHelperClass.assert_true(
main_path.begins_with("res://"), "Main scene path uses res:// protocol"
)
TestHelperClass.assert_true(
main_path.ends_with(".tscn"), "Main scene path has .tscn extension"
)
TestHelperClass.assert_true(main_path.ends_with(".tscn"), "Main scene path has .tscn extension")
# Test that scene files exist
TestHelperClass.assert_true(
ResourceLoader.exists(game_path), "Game scene file exists at path"
)
TestHelperClass.assert_true(
ResourceLoader.exists(main_path), "Main scene file exists at path"
)
TestHelperClass.assert_true(ResourceLoader.exists(game_path), "Game scene file exists at path")
TestHelperClass.assert_true(ResourceLoader.exists(main_path), "Main scene file exists at path")
func test_input_validation():
@@ -134,50 +118,38 @@ func test_input_validation():
# Test empty string validation
game_manager.start_game_with_mode("")
TestHelperClass.assert_equal(
original_mode,
game_manager.pending_gameplay_mode,
"Empty string mode rejected"
original_mode, game_manager.pending_gameplay_mode, "Empty string mode rejected"
)
TestHelperClass.assert_false(
game_manager.is_changing_scene,
"Scene change flag unchanged after empty mode"
game_manager.is_changing_scene, "Scene change flag unchanged after empty mode"
)
# Test null validation - GameManager expects String, so this tests the type safety
# Note: In Godot 4.4, passing null to String parameter causes script error as expected
# The function properly validates empty strings instead
TestHelperClass.assert_equal(
original_mode,
game_manager.pending_gameplay_mode,
"Mode preserved after empty string test"
original_mode, game_manager.pending_gameplay_mode, "Mode preserved after empty string test"
)
TestHelperClass.assert_false(
game_manager.is_changing_scene,
"Scene change flag unchanged after validation tests"
game_manager.is_changing_scene, "Scene change flag unchanged after validation tests"
)
# Test invalid mode validation
game_manager.start_game_with_mode("invalid_mode")
TestHelperClass.assert_equal(
original_mode,
game_manager.pending_gameplay_mode,
"Invalid mode rejected"
original_mode, game_manager.pending_gameplay_mode, "Invalid mode rejected"
)
TestHelperClass.assert_false(
game_manager.is_changing_scene,
"Scene change flag unchanged after invalid mode"
game_manager.is_changing_scene, "Scene change flag unchanged after invalid mode"
)
# Test case sensitivity
game_manager.start_game_with_mode("MATCH3")
TestHelperClass.assert_equal(
original_mode,
game_manager.pending_gameplay_mode,
"Case-sensitive mode validation"
original_mode, game_manager.pending_gameplay_mode, "Case-sensitive mode validation"
)
TestHelperClass.assert_false(
game_manager.is_changing_scene,
"Scene change flag unchanged after wrong case"
game_manager.is_changing_scene, "Scene change flag unchanged after wrong case"
)
@@ -193,19 +165,14 @@ func test_race_condition_protection():
# Verify second request was rejected
TestHelperClass.assert_equal(
original_mode,
game_manager.pending_gameplay_mode,
"Concurrent scene change blocked"
)
TestHelperClass.assert_true(
game_manager.is_changing_scene, "Scene change flag preserved"
original_mode, game_manager.pending_gameplay_mode, "Concurrent scene change blocked"
)
TestHelperClass.assert_true(game_manager.is_changing_scene, "Scene change flag preserved")
# Test exit to main menu during scene change
game_manager.exit_to_main_menu()
TestHelperClass.assert_true(
game_manager.is_changing_scene,
"Exit request blocked during scene change"
game_manager.is_changing_scene, "Exit request blocked during scene change"
)
# Reset state
@@ -224,17 +191,13 @@ func test_gameplay_mode_validation():
# Create a temporary mock to test validation
var test_mode_valid = mode in ["match3", "clickomania"]
TestHelperClass.assert_true(
test_mode_valid, "Valid mode accepted: " + mode
)
TestHelperClass.assert_true(test_mode_valid, "Valid mode accepted: " + mode)
# Test whitelist enforcement
var invalid_modes = ["puzzle", "arcade", "adventure", "rpg", "action"]
for mode in invalid_modes:
var test_mode_invalid = not (mode in ["match3", "clickomania"])
TestHelperClass.assert_true(
test_mode_invalid, "Invalid mode rejected: " + mode
)
TestHelperClass.assert_true(test_mode_invalid, "Invalid mode rejected: " + mode)
func test_scene_transition_safety():
@@ -246,20 +209,12 @@ func test_scene_transition_safety():
# Test scene resource loading
var game_scene = load(game_scene_path)
TestHelperClass.assert_not_null(
game_scene, "Game scene resource loads successfully"
)
TestHelperClass.assert_true(
game_scene is PackedScene, "Game scene is PackedScene type"
)
TestHelperClass.assert_not_null(game_scene, "Game scene resource loads successfully")
TestHelperClass.assert_true(game_scene is PackedScene, "Game scene is PackedScene type")
var main_scene = load(main_scene_path)
TestHelperClass.assert_not_null(
main_scene, "Main scene resource loads successfully"
)
TestHelperClass.assert_true(
main_scene is PackedScene, "Main scene is PackedScene type"
)
TestHelperClass.assert_not_null(main_scene, "Main scene resource loads successfully")
TestHelperClass.assert_true(main_scene is PackedScene, "Main scene is PackedScene type")
# Test that current scene exists
TestHelperClass.assert_not_null(current_scene, "Current scene exists")
@@ -279,14 +234,10 @@ func test_error_handling():
# Verify state preservation after invalid inputs
game_manager.start_game_with_mode("")
TestHelperClass.assert_equal(
original_changing,
game_manager.is_changing_scene,
"State preserved after empty mode error"
original_changing, game_manager.is_changing_scene, "State preserved after empty mode error"
)
TestHelperClass.assert_equal(
original_mode,
game_manager.pending_gameplay_mode,
"Mode preserved after empty mode error"
original_mode, game_manager.pending_gameplay_mode, "Mode preserved after empty mode error"
)
game_manager.start_game_with_mode("invalid")
@@ -296,9 +247,7 @@ func test_error_handling():
"State preserved after invalid mode error"
)
TestHelperClass.assert_equal(
original_mode,
game_manager.pending_gameplay_mode,
"Mode preserved after invalid mode error"
original_mode, game_manager.pending_gameplay_mode, "Mode preserved after invalid mode error"
)
@@ -314,15 +263,9 @@ func test_scene_method_validation():
var has_set_global_score = mock_scene.has_method("set_global_score")
var has_get_global_score = mock_scene.has_method("get_global_score")
TestHelperClass.assert_false(
has_set_gameplay_mode, "Mock scene lacks set_gameplay_mode method"
)
TestHelperClass.assert_false(
has_set_global_score, "Mock scene lacks set_global_score method"
)
TestHelperClass.assert_false(
has_get_global_score, "Mock scene lacks get_global_score method"
)
TestHelperClass.assert_false(has_set_gameplay_mode, "Mock scene lacks set_gameplay_mode method")
TestHelperClass.assert_false(has_set_global_score, "Mock scene lacks set_global_score method")
TestHelperClass.assert_false(has_get_global_score, "Mock scene lacks get_global_score method")
# Clean up mock scene
mock_scene.queue_free()
@@ -341,9 +284,7 @@ func test_pending_mode_management():
# This simulates what would happen in start_game_with_mode
game_manager.pending_gameplay_mode = test_mode
TestHelperClass.assert_equal(
test_mode,
game_manager.pending_gameplay_mode,
"Pending mode set correctly"
test_mode, game_manager.pending_gameplay_mode, "Pending mode set correctly"
)
# Test mode preservation during errors