Phase 14 - Organized directories.
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
|
||||
extends SceneTree
|
||||
|
||||
const PROP_EDITOR := preload("res://scripts/prop_editor.gd")
|
||||
const PROP_FILE := preload("res://scripts/prop_file.gd")
|
||||
const PROP_EDITOR := preload("res://scripts/editors/prop/prop_editor.gd")
|
||||
const PROP_FILE := preload("res://scripts/editors/prop/prop_file.gd")
|
||||
|
||||
var _checks: int = 0
|
||||
var _failures: int = 0
|
||||
@@ -43,10 +43,10 @@ func check(label: String, condition: bool) -> void:
|
||||
func _test_window_title() -> void:
|
||||
check("untitled no path no dirty", PROP_EDITOR.build_window_title("", "", false) == "Untitled")
|
||||
check("name dirty", PROP_EDITOR.build_window_title("My Crate", "", true) == "My Crate *")
|
||||
check("name path clean", PROP_EDITOR.build_window_title("My Crate", "res://props/mycrate.prop", false) == "My Crate — mycrate.prop")
|
||||
check("untitled path dirty", PROP_EDITOR.build_window_title("", "res://props/mycrate.prop", true) == "Untitled — mycrate.prop *")
|
||||
check("name path clean", PROP_EDITOR.build_window_title("My Crate", "res://content/props/mycrate.prop", false) == "My Crate — mycrate.prop")
|
||||
check("untitled path dirty", PROP_EDITOR.build_window_title("", "res://content/props/mycrate.prop", true) == "Untitled — mycrate.prop *")
|
||||
check("whitespace name falls back", PROP_EDITOR.build_window_title(" ", "", false) == "Untitled")
|
||||
check("extension kept in title", PROP_EDITOR.build_window_title("X", "res://props/ball.prop", false).ends_with("ball.prop"))
|
||||
check("extension kept in title", PROP_EDITOR.build_window_title("X", "res://content/props/ball.prop", false).ends_with("ball.prop"))
|
||||
|
||||
|
||||
func _test_mode_button_text() -> void:
|
||||
@@ -80,11 +80,11 @@ func _test_save_safe() -> void:
|
||||
|
||||
|
||||
func _test_recent_list() -> void:
|
||||
var list: Array = PROP_EDITOR.update_recent_list([], "res://props/a.prop", 5)
|
||||
check("recent empty list inserts", list == ["res://props/a.prop"])
|
||||
list = PROP_EDITOR.update_recent_list(["res://props/b.prop", "res://props/a.prop"], "res://props/a.prop", 5)
|
||||
check("recent dedupe moves to front", list == ["res://props/a.prop", "res://props/b.prop"])
|
||||
list = PROP_EDITOR.update_recent_list(["res://props/b.prop", "res://props/c.prop"], "res://props/a.prop", 5)
|
||||
check("recent insert keeps most-recent-first", list == ["res://props/a.prop", "res://props/b.prop", "res://props/c.prop"])
|
||||
list = PROP_EDITOR.update_recent_list(["res://props/b.prop", "res://props/c.prop", "res://props/d.prop", "res://props/e.prop", "res://props/f.prop"], "res://props/a.prop", 5)
|
||||
check("recent trims to max", list.size() == 5 and list[0] == "res://props/a.prop" and list[4] == "res://props/e.prop")
|
||||
var list: Array = PROP_EDITOR.update_recent_list([], "res://content/props/a.prop", 5)
|
||||
check("recent empty list inserts", list == ["res://content/props/a.prop"])
|
||||
list = PROP_EDITOR.update_recent_list(["res://content/props/b.prop", "res://content/props/a.prop"], "res://content/props/a.prop", 5)
|
||||
check("recent dedupe moves to front", list == ["res://content/props/a.prop", "res://content/props/b.prop"])
|
||||
list = PROP_EDITOR.update_recent_list(["res://content/props/b.prop", "res://content/props/c.prop"], "res://content/props/a.prop", 5)
|
||||
check("recent insert keeps most-recent-first", list == ["res://content/props/a.prop", "res://content/props/b.prop", "res://content/props/c.prop"])
|
||||
list = PROP_EDITOR.update_recent_list(["res://content/props/b.prop", "res://content/props/c.prop", "res://content/props/d.prop", "res://content/props/e.prop", "res://content/props/f.prop"], "res://content/props/a.prop", 5)
|
||||
check("recent trims to max", list.size() == 5 and list[0] == "res://content/props/a.prop" and list[4] == "res://content/props/e.prop")
|
||||
|
||||
Reference in New Issue
Block a user