Files
Sansan 5831e1e73d Log through a GameLog autoload instead of print()
GameLog.debug() prints only in debug builds, and GameLog.warning() reports
problems such as unexpected server data or failed downloads.
2026-10-06 11:15:03 +02:00

24 lines
682 B
GDScript

extends GdUnitTestSuite
## GameLog joins its arguments like print() does.
func test_joins_parts_without_spaces_like_print() -> void:
assert_str(GameLog._join(["Song ", 3, " of ", 10.5])).is_equal("Song 3 of 10.5")
func test_joins_any_kind_of_value() -> void:
assert_str(GameLog._join([null, true, [1, 2], {"a": 1}])) \
.is_equal("<null>true[1, 2]{ \"a\": 1 }")
func test_no_parts_gives_an_empty_line() -> void:
assert_str(GameLog._join([])).is_empty()
func test_debug_takes_any_number_of_arguments() -> void:
GameLog.debug()
GameLog.debug("one")
GameLog.debug("one", 2, Vector2.ONE)
# Reaching this line means none of the calls failed
assert_bool(true).is_true()