Skip to content

Commit

Permalink
Derive Var and Export for DynGd<T, D>
Browse files Browse the repository at this point in the history
- Formatting fixes - use newline to seperate steps in given testcase
  • Loading branch information
Yarwin committed Jan 6, 2025
1 parent 3efd56b commit 73f060e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions itest/godot/ManualFfiTests.gd
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ func test_export():

func test_export_dyn_gd():
var dyn_gd_exporter = DynGdExporter.new()
# Nodehealth is valid candidate both for `empty` and `second` fields.

# NodeHealth is valid candidate both for `empty` and `second` fields.
var node = NodeHealth.new()
dyn_gd_exporter.first = node
assert_eq(dyn_gd_exporter.first, node)

dyn_gd_exporter.second = node
assert_eq(dyn_gd_exporter.second, node)

# RefcHealth is valid candidate for `first` field
# RefcHealth is valid candidate for `first` field.
var refc = RefcHealth.new()
dyn_gd_exporter.first = refc
assert_eq(dyn_gd_exporter.first, refc)
Expand All @@ -87,9 +89,11 @@ func test_export_dyn_gd():
func test_export_dyn_gd_should_fail_for_wrong_type():
var dyn_gd_exporter = RcDynGdExporter.new()
var refc = RefcHealth.new()

disable_error_messages()
dyn_gd_exporter.only_node_health = refc # Should fail.
enable_error_messages()

assert_fail("`DynGdExporter.only_node_health` should only accept NodeHealth if it implements InstanceIdProvider trait")

class MockObjGd extends Object:
Expand Down

0 comments on commit 73f060e

Please sign in to comment.