Skip to content

Commit

Permalink
Fix registration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GsLogiMaker committed Nov 22, 2024
1 parent 6c2bd97 commit 7b52bcc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion unittests/scripts/a_component.gd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

extends GFComponent

const CONST:= preload("res://components/b_module.gd")
const CONST:= preload("./b_module.gd")
4 changes: 2 additions & 2 deletions unittests/scripts/a_module.gd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

extends GFModule

const DictionaryC:= preload("res://components/dictionary.gd")
const DictionaryC:= preload("./dictionary.gd")

class SubEntity extends GFRegisterableEntity: pass

const b_module:= preload("res://components/b_module.gd")
const b_module:= preload("./b_module.gd")
12 changes: 8 additions & 4 deletions unittests/test_registration.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
@tool
extends GutTest

const AModule = preload("./scripts/a_module.gd")
const AComponent = preload("./scripts/a_component.gd")
const AEntity = preload("./scripts/a_entity.gd")

var world:GFWorld

func before_all():
Expand All @@ -14,7 +18,7 @@ func after_all():

func test_auto_register_script():
GFEntity.spawn(world) \
.add_component(load("res://components/a_component.gd"))
.add_component(AComponent)

assert_ne(
world.lookup(
Expand All @@ -24,7 +28,7 @@ func test_auto_register_script():
)

func test_register_script_module():
world.register_script(load("res://components/a_module.gd"))
world.register_script(AModule)

assert_ne(
world.lookup(
Expand All @@ -46,7 +50,7 @@ func test_register_script_module():
)

func test_register_script_component_script():
world.register_script(load("res://components/a_component.gd"))
world.register_script(AComponent)

assert_ne(
world.lookup(
Expand All @@ -56,7 +60,7 @@ func test_register_script_component_script():
)

func test_register_script_entity_script():
world.register_script(load("res://components/a_entity.gd"))
world.register_script(AEntity)

assert_ne(
world.lookup(
Expand Down
1 change: 1 addition & 0 deletions unittests/test_simple_systems.gd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

@tool
extends GutTest

var world:GFWorld
Expand Down

0 comments on commit 7b52bcc

Please sign in to comment.