Compare commits
3 commits
14b5989f26
...
509667045d
Author | SHA1 | Date | |
---|---|---|---|
509667045d | |||
98d1e9d239 | |||
17cecf5ef3 |
3 changed files with 26 additions and 18 deletions
|
@ -23,8 +23,19 @@ var singles: Array[CoreValidationSingle]
|
||||||
|
|
||||||
# +++ module +++
|
# +++ module +++
|
||||||
func _cleanup() -> void:
|
func _cleanup() -> void:
|
||||||
|
# Schemas
|
||||||
|
var schemas_remove_enty: Array[CoreValidationSchema] = []
|
||||||
|
for schema in schemas:
|
||||||
|
schemas_remove_enty.append(schema)
|
||||||
|
if !is_instance_valid(schema): continue
|
||||||
|
if !is_instance_valid(schema.parent):
|
||||||
|
logger.diag("Removing schema '" + schema.name + "'")
|
||||||
|
schema.queue_free()
|
||||||
|
for schema in schemas_remove_enty:
|
||||||
|
schemas.remove_at(schemas.find(schema))
|
||||||
|
|
||||||
# Singles
|
# Singles
|
||||||
var singles_remove_enty: Array[CoreLoggerInstance] = []
|
var singles_remove_enty: Array[CoreValidationSingle] = []
|
||||||
for single in singles:
|
for single in singles:
|
||||||
singles_remove_enty.append(single)
|
singles_remove_enty.append(single)
|
||||||
if !is_instance_valid(single): continue
|
if !is_instance_valid(single): continue
|
||||||
|
@ -34,17 +45,6 @@ func _cleanup() -> void:
|
||||||
for single in singles_remove_enty:
|
for single in singles_remove_enty:
|
||||||
singles.remove_at(singles.find(single))
|
singles.remove_at(singles.find(single))
|
||||||
|
|
||||||
# Schemas
|
|
||||||
var schemas_remove_enty: Array[CoreLoggerInstance] = []
|
|
||||||
for schema in schemas:
|
|
||||||
singles_remove_enty.append(schema)
|
|
||||||
if !is_instance_valid(schema): continue
|
|
||||||
if !is_instance_valid(schema.parent):
|
|
||||||
logger.diag("Removing schema '" + schema.name + "'")
|
|
||||||
schema.queue_free()
|
|
||||||
for schema in schemas_remove_enty:
|
|
||||||
schemas.remove_at(schemas.find(schema))
|
|
||||||
|
|
||||||
func _schedule() -> void:
|
func _schedule() -> void:
|
||||||
# Singles
|
# Singles
|
||||||
for single in singles:
|
for single in singles:
|
||||||
|
@ -61,10 +61,12 @@ func _schedule() -> void:
|
||||||
# +++ data validation +++
|
# +++ data validation +++
|
||||||
## Returns a new [CoreValidationSingle]
|
## Returns a new [CoreValidationSingle]
|
||||||
func get_single(data, parent: Node) -> CoreValidationSingle:
|
func get_single(data, parent: Node) -> CoreValidationSingle:
|
||||||
singles.append(parent)
|
var single: CoreValidationSingle = CoreValidationSingle.new(core, data, parent)
|
||||||
return CoreValidationSingle.new(core, data, parent)
|
singles.append(single)
|
||||||
|
return single
|
||||||
|
|
||||||
## Returns a new [CoreValidationSchema]
|
## Returns a new [CoreValidationSchema]
|
||||||
func get_schema(schema: Dictionary, parent: Node) -> CoreValidationSchema:
|
func get_schema(schema_dict: Dictionary, parent: Node) -> CoreValidationSchema:
|
||||||
schemas.append(parent)
|
var schema: CoreValidationSchema = CoreValidationSchema.new(core, schema_dict, parent)
|
||||||
return CoreValidationSchema.new(core, schema, parent)
|
schemas.append(schema)
|
||||||
|
return schema
|
||||||
|
|
|
@ -160,7 +160,12 @@ func test_get_center() -> void:
|
||||||
# stringify_variables
|
# stringify_variables
|
||||||
func test_stringify_variables() -> void:
|
func test_stringify_variables() -> void:
|
||||||
# Init CORE
|
# Init CORE
|
||||||
await load_framework()
|
var core_config: CoreConfiguration = CoreConfiguration.new()
|
||||||
|
core_config.misc_stringify_show_type = true
|
||||||
|
core_config.misc_stringify_color_range8 = true
|
||||||
|
core_config.misc_stringify_array = true
|
||||||
|
core_config.misc_stringify_dictionary = true
|
||||||
|
await load_framework(core_config)
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
var test_in_string: String = "null=%null%\nbool=%bool%\nint=%int%\nfloat=%float%\nstring=%string%\nstringname=%stringname%\ncolor=%color%\narray=%array%\ndict=%dictionary%\nnodepath=%nodepath%\nvec2=%vector2%\nvec2i=%vector2i%\nrect2=%rect2%\nrect2i=%rect2i%\ntrans2d=%transform2d%\nvec3=%vector3%\nvec3i=%vector3i%\nplane=%plane%\nquarternion=%quaternion%\naabb=%aabb%\ntrans3d=%transform3d%\nbasis=%basis%\nprojection=%projection%\nvec4=%vector4%\nvec4i=%vector4i%"
|
var test_in_string: String = "null=%null%\nbool=%bool%\nint=%int%\nfloat=%float%\nstring=%string%\nstringname=%stringname%\ncolor=%color%\narray=%array%\ndict=%dictionary%\nnodepath=%nodepath%\nvec2=%vector2%\nvec2i=%vector2i%\nrect2=%rect2%\nrect2i=%rect2i%\ntrans2d=%transform2d%\nvec3=%vector3%\nvec3i=%vector3i%\nplane=%plane%\nquarternion=%quaternion%\naabb=%aabb%\ntrans3d=%transform3d%\nbasis=%basis%\nprojection=%projection%\nvec4=%vector4%\nvec4i=%vector4i%"
|
||||||
|
|
|
@ -25,6 +25,7 @@ var callback: String = ""
|
||||||
# Unload framework after each test
|
# Unload framework after each test
|
||||||
func after_each() -> void:
|
func after_each() -> void:
|
||||||
callback = ""
|
callback = ""
|
||||||
|
await wait_process_time() # Prevent output overflows
|
||||||
await unload_framework()
|
await unload_framework()
|
||||||
|
|
||||||
# Framework management
|
# Framework management
|
||||||
|
|
Loading…
Reference in a new issue