diff --git a/unittests/test_entities.gd b/unittests/test_entities.gd index 44b42ff..af6f0b6 100644 --- a/unittests/test_entities.gd +++ b/unittests/test_entities.gd @@ -88,6 +88,7 @@ func test_builder(): .set_name("Built") \ .add_entity(Foo) \ .add_pair(Foo, Stringy) \ + .add_pair(Stringy, Foo) \ .build() assert_eq(e.get_name(), "Built", "Expected entity to be named 'Built'") @@ -95,6 +96,7 @@ func test_builder(): var query:GFQuery = GFQueryBuilder.new_in_world(world) \ .with(Foo) \ .with(world.pair(Foo, Stringy)) \ + .with(world.pair(Stringy, Foo)) \ .build() var i:= 0 @@ -108,16 +110,18 @@ func test_builder(): #region Classes class Foo extends GFComponent: - func _build(b_: GFComponentBuilder) -> void: - b_.add_member("value", TYPE_FLOAT) + func _build(b_: GFComponentBuilder) -> void: b_ \ + .set_name("Foo") \ + .add_member("value", TYPE_FLOAT) var value:float: get: return getm(&"value") set(v): setm(&"value", v) class Stringy extends GFComponent: - func _build(b_: GFComponentBuilder) -> void: - b_.add_member("a", TYPE_STRING) - b_.add_member("b", TYPE_STRING) + func _build(b_: GFComponentBuilder) -> void: b_ \ + .set_name("Stringy") \ + .add_member("a", TYPE_STRING) \ + .add_member("b", TYPE_STRING) var a:String: get: return getm(&"a") set(v): setm(&"a", v) @@ -126,15 +130,17 @@ class Stringy extends GFComponent: set(v): setm(&"b", v) class Unadded extends GFComponent: - func _build(b_: GFComponentBuilder) -> void: - b_.add_member("value", TYPE_INT) + func _build(b_: GFComponentBuilder) -> void: b_ \ + .set_name("Unadded") \ + .add_member("value", TYPE_INT) var value:int: get: return getm(&"value") set(v): setm(&"value", v) class Unregistered extends GFComponent: - func _build(b_: GFComponentBuilder) -> void: - b_.add_member("value", TYPE_INT) + func _build(b_: GFComponentBuilder) -> void: b_ \ + .set_name("Unregistered") \ + .add_member("value", TYPE_INT) var value:int: get: return getm(&"value") set(v): setm(&"value", v)