Extract SnapshotHandler (static snapshot parsing), SnapshotConsumers (non-dialogue consumers + audio handlers), and DialogueCoordinator (dialogue consumers + signal handlers) as class_name scripts. main.gd: 28KB → 13KB. game_state.gd: 20KB → 8.5KB. Autoload parse-order safety maintained via load() inline pattern. Ticket: #775 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 lines
938 B
GDScript
29 lines
938 B
GDScript
## Smoke tests for main scene initialization
|
|
## Run with: godot4 --headless --path . -s res://addons/gdUnit4/bin/GdUnitCmdTool.gd
|
|
## --ignoreHeadlessMode -a res://tests/
|
|
class_name TestMainScene
|
|
extends GdUnitTestSuite
|
|
|
|
# Smoke test: main scene loads without errors
|
|
func test_main_scene_loads() -> void:
|
|
var scene = load("res://scenes/main.tscn")
|
|
assert_that(scene).is_not_null()
|
|
|
|
var instance = scene.instantiate()
|
|
assert_that(instance).is_not_null()
|
|
|
|
# Add to scene tree briefly to trigger _ready()
|
|
auto_free(instance)
|
|
add_child(instance)
|
|
|
|
# Verify key nodes exist
|
|
assert_that(instance.get_node("World")).is_not_null()
|
|
assert_that(instance.get_node("Camera2D")).is_not_null()
|
|
assert_that(instance.get_node("UILayer")).is_not_null()
|
|
|
|
# Test: autoloads exist
|
|
func test_autoloads_registered() -> void:
|
|
assert_that(SimBridge).is_not_null()
|
|
assert_that(GameState).is_not_null()
|
|
assert_that(InputMapper).is_not_null()
|