class_name TestCase extends RefCounted ## Base of every test script. Checks collect failures instead of stopping at ## the first one, so a run shows everything that is wrong. var failures: PackedStringArray = [] ## The running SceneTree, for tests that need frames or nodes. var tree: SceneTree func check(condition: bool, message: String) -> void: if not condition: failures.append(message) ## Fails unless `actual` and `expected` have the same type and value. func check_eq(actual: Variant, expected: Variant, message: String) -> void: if typeof(actual) != typeof(expected) or actual != expected: failures.append("%s: expected %s, got %s" % [message, expected, actual])