Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
local type = world.get_type_by_name("UnitStruct")
local constructed = construct(type, {})

assert(constructed ~= nil, "Value was not constructed")
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let type = world.get_type_by_name.call("UnitStruct");
let constructed = construct.call(type, #{});
23 changes: 17 additions & 6 deletions crates/testing_crates/test_utils/src/test_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ impl TestResourceWithVariousFields {
}
}

#[derive(Component, Reflect, PartialEq, Eq, Debug, Default)]
#[reflect(Component, Default)]
pub struct UnitStruct;

impl UnitStruct {
pub fn init() -> Self {
Self
}
}

#[derive(Component, Reflect, PartialEq, Eq, Debug, Default)]
#[reflect(Component, Default)]
pub struct SimpleStruct {
Expand Down Expand Up @@ -262,14 +272,15 @@ impl_test_component_ids!(
CompWithDefault => 2,
CompWithDefaultAndComponentData => 3,
CompWithFromWorldAndComponentData => 4,
SimpleStruct => 5,
SimpleTupleStruct => 6,
SimpleEnum => 7,
UnitStruct => 5,
SimpleStruct => 6,
SimpleTupleStruct => 7,
SimpleEnum => 8,
],
[
TestResource => 8,
ResourceWithDefault => 9,
TestResourceWithVariousFields => 10,
TestResource => 9,
ResourceWithDefault => 10,
TestResourceWithVariousFields => 11,
]
);

Expand Down
Loading