Files
step3/tests/simulation_history_test.gd
T

20 lines
694 B
GDScript

extends SceneTree
var failures := 0
func _initialize() -> void:
var history = load("res://scripts/ui/simulation_history.gd")
_assert(history._action_for_state("completed") == "results", "completed simulations should open results")
_assert(history._action_for_state("block_active") == "resume", "active blocks should resume")
_assert(history._action_for_state("between_blocks") == "resume", "between-block simulations should resume")
_assert(history._action_for_state("abandoned") == "none", "abandoned simulations should be read-only")
quit(1 if failures > 0 else 0)
func _assert(condition: bool, message: String) -> void:
if condition:
return
failures += 1
push_error(message)