extends TestCase ## R2: the application icon. The PNGs are renders of the hand-written SVG, in Palette ## colours, and the project uses one as its window icon. const APP_ICON: GDScript = preload("res://tools/app_icon.gd") func test_every_size_is_the_svg_rendered_at_that_size() -> void: var svg: String = FileAccess.get_file_as_string(APP_ICON.SOURCE) assert_true(svg.begins_with(" void: var svg: String = FileAccess.get_file_as_string(APP_ICON.SOURCE) var allowed: Dictionary = {} for colour: Color in [Palette.INK, Palette.CANVAS, Palette.DRESSED_STONE, Palette.SEA_PAINT, Palette.SEA_DEEP, Palette.SALT, Palette.OILSKIN, Palette.OCHRE_RED]: allowed["#" + colour.to_html(false).to_lower()] = true var found: RegEx = RegEx.create_from_string("#[0-9a-fA-F]{6}") var used: int = 0 for match: RegExMatch in found.search_all(svg): used += 1 assert_true(allowed.has(match.get_string().to_lower()), "%s is not a palette colour" % match.get_string()) assert_true(used >= 6) func test_the_project_uses_it_as_its_icon() -> void: var icon: String = String(ProjectSettings.get_setting("application/config/icon", "")) assert_true(icon.begins_with("res://assets/icons/app/"), "application/config/icon is '%s'" % icon) assert_true(ResourceLoader.exists(icon))