diff --git a/assets/tests/data/access/multiple_read_refs.rhai b/assets/tests/data/access/multiple_read_refs.rhai deleted file mode 100644 index 875e8eff06..0000000000 --- a/assets/tests/data/access/multiple_read_refs.rhai +++ /dev/null @@ -1,3 +0,0 @@ -let entity = Entity.from_raw.call(9999); -// does not throw -let out = entity.eq.call(entity); \ No newline at end of file diff --git a/assets/tests/data/add/vec3.rhai b/assets/tests/data/add/vec3.rhai deleted file mode 100644 index c538e36e29..0000000000 --- a/assets/tests/data/add/vec3.rhai +++ /dev/null @@ -1,11 +0,0 @@ -let a = Vec3.new_.call(1.0, 2.0, 3.0); -let b = Vec3.new_.call(4.0, 5.0, 6.0); - -assert((a + 1).x == 2.0, "Addition did not work"); -assert((a + 1).y == 3.0, "Addition did not work"); -assert((a + 1).z == 4.0, "Addition did not work"); - -assert((a + b).x == 5.0, "Addition did not work"); -assert((a + b).y == 7.0, "Addition did not work"); -assert((a + b).z == 9.0, "Addition did not work"); - diff --git a/assets/tests/data/add_default_component/component_no_default_or_from_world_data_errors.rhai b/assets/tests/data/add_default_component/component_no_default_or_from_world_data_errors.rhai deleted file mode 100644 index 463d3100c0..0000000000 --- a/assets/tests/data/add_default_component/component_no_default_or_from_world_data_errors.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let entity = world.spawn_.call(); -let type = world.get_type_by_name.call("TestComponent"); - -assert_throws(||{ - world.add_default_component.call(entity, type); -},"Missing type data ReflectDefault or ReflectFromWorld for type: .*TestComponent.*"); \ No newline at end of file diff --git a/assets/tests/data/add_default_component/component_with_default_and_component_data_adds_default.rhai b/assets/tests/data/add_default_component/component_with_default_and_component_data_adds_default.rhai deleted file mode 100644 index e2ce895868..0000000000 --- a/assets/tests/data/add_default_component/component_with_default_and_component_data_adds_default.rhai +++ /dev/null @@ -1,9 +0,0 @@ -let entity = world.spawn_.call(); -let _type = world.get_type_by_name.call("CompWithDefaultAndComponentData"); -world.add_default_component.call(entity, _type); - -let added = world.has_component.call(entity, _type); -assert(type_of(added) != "()", "Component not added"); - -let component = world.get_component.call(entity, _type); -assert(component["_0"] == "Default", "Component did not have default value, got: " + component["_0"]); \ No newline at end of file diff --git a/assets/tests/data/add_default_component/component_with_default_no_component_data_errors.rhai b/assets/tests/data/add_default_component/component_with_default_no_component_data_errors.rhai deleted file mode 100644 index 988642e16c..0000000000 --- a/assets/tests/data/add_default_component/component_with_default_no_component_data_errors.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let entity = world.spawn_.call(); -let _type = world.get_type_by_name.call("CompWithDefault"); - -assert_throws(||{ - world.add_default_component.call(entity, _type); -}, "Missing type data ReflectComponent for type: .*CompWithDefault.*") diff --git a/assets/tests/data/add_default_component/component_with_from_world_and_component_data_adds_default.rhai b/assets/tests/data/add_default_component/component_with_from_world_and_component_data_adds_default.rhai deleted file mode 100644 index 63c81f3dec..0000000000 --- a/assets/tests/data/add_default_component/component_with_from_world_and_component_data_adds_default.rhai +++ /dev/null @@ -1,9 +0,0 @@ -let entity = world.spawn_.call(); -let _type = world.get_type_by_name.call("CompWithFromWorldAndComponentData"); -world.add_default_component.call(entity, _type); - -let added = world.has_component.call(entity, _type); -assert(type_of(added) != "()", "Component not added"); - -let component = world.get_component.call(entity, _type); -assert(component["_0"] == "Default", "Component did not have default value, got: " + component["_0"]) \ No newline at end of file diff --git a/assets/tests/data/add_default_component/component_with_from_world_no_component_data_errors.rhai b/assets/tests/data/add_default_component/component_with_from_world_no_component_data_errors.rhai deleted file mode 100644 index 323dfb84d1..0000000000 --- a/assets/tests/data/add_default_component/component_with_from_world_no_component_data_errors.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let entity = world.spawn_.call(); -let _type = world.get_type_by_name.call("CompWithFromWorld"); - -assert_throws(||{ - world.add_default_component.call(entity, _type); -}, "Missing type data ReflectComponent for type: .*CompWithFromWorld.*") \ No newline at end of file diff --git a/assets/tests/data/api_availability/api_available_on_callback.rhai b/assets/tests/data/api_availability/api_available_on_callback.rhai deleted file mode 100644 index d37af11858..0000000000 --- a/assets/tests/data/api_availability/api_available_on_callback.rhai +++ /dev/null @@ -1,5 +0,0 @@ -fn on_test() { - assert!(type_of(world) != "()", "World was not found"); - assert!(type_of(world.get_type_by_name.call("TestComponent")) != "()", "Could not find TestComponent type"); - Entity.from_raw.call(1); -} \ No newline at end of file diff --git a/assets/tests/data/api_availability/api_available_on_script_load.rhai b/assets/tests/data/api_availability/api_available_on_script_load.rhai deleted file mode 100644 index 5661f55644..0000000000 --- a/assets/tests/data/api_availability/api_available_on_script_load.rhai +++ /dev/null @@ -1,3 +0,0 @@ -assert!(type_of(world) != "()", "World was not found"); -assert!(type_of(world.get_type_by_name.call("TestComponent")) != "()", "Could not find TestComponent type"); -let out = Entity.from_raw.call(1); \ No newline at end of file diff --git a/assets/tests/data/clear/vec.rhai b/assets/tests/data/clear/vec.rhai deleted file mode 100644 index 4f1d5e7d10..0000000000 --- a/assets/tests/data/clear/vec.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -res.vec_usize.clear.call(); - -assert(res.vec_usize.len.call() == 0, "Clear did not work"); \ No newline at end of file diff --git a/assets/tests/data/construct/simple_enum.rhai b/assets/tests/data/construct/simple_enum.rhai deleted file mode 100644 index 463de1f9a7..0000000000 --- a/assets/tests/data/construct/simple_enum.rhai +++ /dev/null @@ -1,18 +0,0 @@ -let type = world.get_type_by_name.call("SimpleEnum"); - -// Struct Variant -let constructed = construct.call(type, #{ variant: "Struct", foo: 123 }); - -assert(constructed.variant_name.call() == "Struct", "Value was constructed incorrectly, expected constructed.variant to be Struct but got " + constructed.variant_name.call()); -assert(constructed.foo == 123, "Value was constructed incorrectly, expected constructed.foo to be 123 but got " + constructed.foo); - -// TupleStruct Variant -constructed = construct.call(type, #{ variant: "TupleStruct", "_0": 123 }); - -assert(constructed.variant_name.call() == "TupleStruct", "Value was constructed incorrectly, expected constructed.variant to be TupleStruct but got " + constructed.variant_name.call()); -assert(constructed["_0"] == 123, "Value was constructed incorrectly, expected constructed._0 to be 123 but got " + constructed["_0"]); - -// Unit Variant -constructed = construct.call(type, #{ variant: "Unit" }); - -assert(constructed.variant_name.call() == "Unit", "Value was constructed incorrectly, expected constructed.variant to be Unit but got " + constructed.variant_name.call()); \ No newline at end of file diff --git a/assets/tests/data/construct/simple_struct.rhai b/assets/tests/data/construct/simple_struct.rhai deleted file mode 100644 index e35edbddd2..0000000000 --- a/assets/tests/data/construct/simple_struct.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let type = world.get_type_by_name.call("SimpleStruct"); -let constructed = construct.call(type, #{ foo: 123 }); - -assert(constructed.foo == 123, "Value was constructed incorrectly, expected constructed.foo to be 123 but got " + constructed.foo); \ No newline at end of file diff --git a/assets/tests/data/construct/simple_tuple_struct.rhai b/assets/tests/data/construct/simple_tuple_struct.rhai deleted file mode 100644 index 411b3e806f..0000000000 --- a/assets/tests/data/construct/simple_tuple_struct.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let type = world.get_type_by_name.call("SimpleTupleStruct"); -let constructed = construct.call(type, #{ "_0": 123 }); - -assert(constructed["_0"] == 123, "Value was constructed incorrectly, expected constructed.foo to be 123 but got " + constructed["_0"]); \ No newline at end of file diff --git a/assets/tests/data/despawn/despawns_only_root.rhai b/assets/tests/data/despawn/despawns_only_root.rhai deleted file mode 100644 index 5c3a8fc466..0000000000 --- a/assets/tests/data/despawn/despawns_only_root.rhai +++ /dev/null @@ -1,7 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); -world.push_children.call(entity, [child]); -world.despawn.call(entity); - -assert(world.has_entity.call(entity) == false, "Parent should be despawned"); -assert(world.has_entity.call(child) == true, "Child should not be despawned"); diff --git a/assets/tests/data/despawn/invalid_entity_errors.rhai b/assets/tests/data/despawn/invalid_entity_errors.rhai deleted file mode 100644 index 730fca0782..0000000000 --- a/assets/tests/data/despawn/invalid_entity_errors.rhai +++ /dev/null @@ -1,3 +0,0 @@ -assert_throws(||{ - world.despawn_recursive.call(Entity.from_raw.call(9999)) -}, "Missing or invalid entity"); \ No newline at end of file diff --git a/assets/tests/data/despawn_descendants/despawns_only_child.rhai b/assets/tests/data/despawn_descendants/despawns_only_child.rhai deleted file mode 100644 index fb6996cee4..0000000000 --- a/assets/tests/data/despawn_descendants/despawns_only_child.rhai +++ /dev/null @@ -1,7 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); -world.push_children.call(entity, [child]); -world.despawn_descendants.call(entity); - -assert(world.has_entity.call(entity) == true, "Parent should not be despawned"); -assert(world.has_entity.call(child) == false, "Child should be despawned"); diff --git a/assets/tests/data/despawn_descendants/invalid_entity_errors.rhai b/assets/tests/data/despawn_descendants/invalid_entity_errors.rhai deleted file mode 100644 index bdaa98ff33..0000000000 --- a/assets/tests/data/despawn_descendants/invalid_entity_errors.rhai +++ /dev/null @@ -1,3 +0,0 @@ -assert_throws(||{ - world.despawn_recursive.call(Entity.from_raw.call(9999)); -}, "Missing or invalid entity") \ No newline at end of file diff --git a/assets/tests/data/despawn_recursive/despawns_recursively.rhai b/assets/tests/data/despawn_recursive/despawns_recursively.rhai deleted file mode 100644 index 8d4e2ab757..0000000000 --- a/assets/tests/data/despawn_recursive/despawns_recursively.rhai +++ /dev/null @@ -1,7 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); -world.push_children.call(entity, [child]); -world.despawn_recursive.call(entity); - -assert(world.has_entity.call(entity) == false, "Parent should be despawned"); -assert(world.has_entity.call(child) == false, "Child should be despawned"); diff --git a/assets/tests/data/despawn_recursive/invalid_entity_errors.rhai b/assets/tests/data/despawn_recursive/invalid_entity_errors.rhai deleted file mode 100644 index bdaa98ff33..0000000000 --- a/assets/tests/data/despawn_recursive/invalid_entity_errors.rhai +++ /dev/null @@ -1,3 +0,0 @@ -assert_throws(||{ - world.despawn_recursive.call(Entity.from_raw.call(9999)); -}, "Missing or invalid entity") \ No newline at end of file diff --git a/assets/tests/data/div/vec3.rhai b/assets/tests/data/div/vec3.rhai deleted file mode 100644 index af3a96d5f0..0000000000 --- a/assets/tests/data/div/vec3.rhai +++ /dev/null @@ -1,10 +0,0 @@ -let a = Vec3.new_.call(2.0, 4.0, 6.0); -let b = Vec3.new_.call(1.0, 2.0, 3.0); - -assert((a / 2).x == 1.0, "Division did not work"); -assert((a / 2).y == 2.0, "Division did not work"); -assert((a / 2).z == 3.0, "Division did not work"); - -assert((a / b).x == 2.0, "Division did not work"); -assert((a / b).y == 2.0, "Division did not work"); -assert((a / b).z == 2.0, "Division did not work"); \ No newline at end of file diff --git a/assets/tests/data/eq/vec3.rhai b/assets/tests/data/eq/vec3.rhai deleted file mode 100644 index f4652fed8c..0000000000 --- a/assets/tests/data/eq/vec3.rhai +++ /dev/null @@ -1,7 +0,0 @@ -let a = Vec3.new_.call(2.0, -4.0, 6.0); -let b = Vec3.new_.call(4.0, 5.0, 6.0); - - -assert((a == b) == false, "Equality did not work"); -assert((a != b) == true, "Inequality did not work"); -assert((a == a) == true, "Equality did not work"); \ No newline at end of file diff --git a/assets/tests/data/functions/contains_reflect_reference_functions.rhai b/assets/tests/data/functions/contains_reflect_reference_functions.rhai deleted file mode 100644 index f83b980c99..0000000000 --- a/assets/tests/data/functions/contains_reflect_reference_functions.rhai +++ /dev/null @@ -1,14 +0,0 @@ - -let Resource = world.get_type_by_name.call("TestResource"); -let resource = world.get_resource.call(Resource); - -let functions = resource.functions.call(); -assert(functions.len() > 0, "functions should not be empty"); - -let available_names = []; - -for function_ref in functions { - available_names.push(function_ref.name); -} - -assert("display_ref" in available_names, "functions should contain display_ref, but got: " + available_names); \ No newline at end of file diff --git a/assets/tests/data/get_children/has_children_returns_them.rhai b/assets/tests/data/get_children/has_children_returns_them.rhai deleted file mode 100644 index 1f8bece3a4..0000000000 --- a/assets/tests/data/get_children/has_children_returns_them.rhai +++ /dev/null @@ -1,9 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); - -world.push_children.call(entity, [child]); - -let children = world.get_children.call(entity); - -assert(children.len == 1, "Expected 1 child"); -assert(children[0].index.call() == child.index.call(), "Child is the wrong entity"); \ No newline at end of file diff --git a/assets/tests/data/get_children/invalid_entity_errors.rhai b/assets/tests/data/get_children/invalid_entity_errors.rhai deleted file mode 100644 index 90bf506ca9..0000000000 --- a/assets/tests/data/get_children/invalid_entity_errors.rhai +++ /dev/null @@ -1,3 +0,0 @@ -assert_throws(||{ - world.get_children.call(Entity.from_raw.call(9999)); -}, "Missing or invalid entity"); diff --git a/assets/tests/data/get_children/no_children_returns_empty_table.rhai b/assets/tests/data/get_children/no_children_returns_empty_table.rhai deleted file mode 100644 index 1ecc14c5a0..0000000000 --- a/assets/tests/data/get_children/no_children_returns_empty_table.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let entity = world.spawn_.call(); -let children = world.get_children.call(entity); - -assert(children.len == 0); \ No newline at end of file diff --git a/assets/tests/data/get_component/component_no_component_data.rhai b/assets/tests/data/get_component/component_no_component_data.rhai deleted file mode 100644 index 1000055921..0000000000 --- a/assets/tests/data/get_component/component_no_component_data.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let component = world.get_type_by_name.call("CompWithDefault"); -let entity = world._get_entity_with_test_component.call("CompWithDefault"); -let retrieved = world.get_component.call(entity, component); - -assert(type_of(retrieved) != "()", "Component was not found"); -assert(retrieved["_0"] == "Initial Value", "Component data was not retrieved correctly, retrieved._0 was: " + retrieved["_0"]); \ No newline at end of file diff --git a/assets/tests/data/get_component/component_with_component_data.rhai b/assets/tests/data/get_component/component_with_component_data.rhai deleted file mode 100644 index 7a638c20ea..0000000000 --- a/assets/tests/data/get_component/component_with_component_data.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let component = world.get_type_by_name.call("TestComponent"); -let entity = world._get_entity_with_test_component.call("TestComponent"); -let retrieved = world.get_component.call(entity, component); - -assert(type_of(retrieved) != "()", "Component was not found"); -assert(retrieved.strings[0] == "Initial", "Component data was not retrieved correctly, retrieved.strings[0] was: " + retrieved.strings[0]); \ No newline at end of file diff --git a/assets/tests/data/get_component/empty_entity_component_with_component_data.rhai b/assets/tests/data/get_component/empty_entity_component_with_component_data.rhai deleted file mode 100644 index 42c4abc0f1..0000000000 --- a/assets/tests/data/get_component/empty_entity_component_with_component_data.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let component = world.get_type_by_name.call("TestComponent"); -let entity = world.spawn_.call(); -let retrieved = world.get_component.call(entity, component); - -assert(type_of(retrieved) == "()", "Component found"); \ No newline at end of file diff --git a/assets/tests/data/get_parent/has_parent_returns_it.rhai b/assets/tests/data/get_parent/has_parent_returns_it.rhai deleted file mode 100644 index a992e6068c..0000000000 --- a/assets/tests/data/get_parent/has_parent_returns_it.rhai +++ /dev/null @@ -1,9 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); - -world.push_children.call(entity, [child]); - -let parent = world.get_parent.call(child); - -assert(type_of(parent) != "()", "Expected a parent"); -assert(parent.index.call() == entity.index.call(), "Parent is the wrong entity"); \ No newline at end of file diff --git a/assets/tests/data/get_parent/invalid_entity_errors.rhai b/assets/tests/data/get_parent/invalid_entity_errors.rhai deleted file mode 100644 index b25d0981df..0000000000 --- a/assets/tests/data/get_parent/invalid_entity_errors.rhai +++ /dev/null @@ -1,4 +0,0 @@ - -assert_throws(||{ - world.get_parent.call(Entity.from_raw.call(9999)); -}, "Missing or invalid entity"); diff --git a/assets/tests/data/get_parent/no_parent_returns_nil.rhai b/assets/tests/data/get_parent/no_parent_returns_nil.rhai deleted file mode 100644 index d4abc7d2d5..0000000000 --- a/assets/tests/data/get_parent/no_parent_returns_nil.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let entity = world.spawn_.call(); -let parent = world.get_parent.call(entity); - -assert(type_of(parent) == "()", "Expected no parents"); diff --git a/assets/tests/data/get_resource/missing_resource_returns_nil.rhai b/assets/tests/data/get_resource/missing_resource_returns_nil.rhai deleted file mode 100644 index e127d1a958..0000000000 --- a/assets/tests/data/get_resource/missing_resource_returns_nil.rhai +++ /dev/null @@ -1,2 +0,0 @@ -let type = world._get_mock_resource_type.call(); -assert(type_of(world.get_resource.call(type)) == "()", "Resource should not exist"); \ No newline at end of file diff --git a/assets/tests/data/get_resource/no_resource_data_returns_resource.rhai b/assets/tests/data/get_resource/no_resource_data_returns_resource.rhai deleted file mode 100644 index 3c172e5ac3..0000000000 --- a/assets/tests/data/get_resource/no_resource_data_returns_resource.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let resource = world.get_type_by_name.call("ResourceWithDefault"); - -let retrieved = world.get_resource.call(resource); -assert(type_of(retrieved) != "()", "Resource should exist"); -assert(retrieved["_0"] == "Initial Value", "Resource should have default value but got: " + retrieved["_0"]); diff --git a/assets/tests/data/get_resource/with_resource_data_returns_resource.rhai b/assets/tests/data/get_resource/with_resource_data_returns_resource.rhai deleted file mode 100644 index c0f657d6b8..0000000000 --- a/assets/tests/data/get_resource/with_resource_data_returns_resource.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let resource = world.get_type_by_name.call("TestResource"); - -let retrieved = world.get_resource.call(resource); -assert(type_of(retrieved) != "()", "Resource should exist"); -assert(retrieved.bytes[1] == 1, "Resource should have default value but got resource with #retrieved.bytes[1]: " + retrieved.bytes[1]); diff --git a/assets/tests/data/get_type_by_name/missing_type_returns_nothing.rhai b/assets/tests/data/get_type_by_name/missing_type_returns_nothing.rhai deleted file mode 100644 index 2ac4944019..0000000000 --- a/assets/tests/data/get_type_by_name/missing_type_returns_nothing.rhai +++ /dev/null @@ -1,3 +0,0 @@ -let type = world.get_type_by_name.call("MissingType"); - -assert(type == (), "Unregistered type was found"); diff --git a/assets/tests/data/get_type_by_name/registered_type_returns_correct_type.rhai b/assets/tests/data/get_type_by_name/registered_type_returns_correct_type.rhai deleted file mode 100644 index 00f5379b8a..0000000000 --- a/assets/tests/data/get_type_by_name/registered_type_returns_correct_type.rhai +++ /dev/null @@ -1,17 +0,0 @@ -let type = world.get_type_by_name.call("TestComponent"); - -assert(type_of(type) != "()", "Registered type was not found"); - -let expected_type_name = "test_utils::test_data::TestComponent"; -let expected_short_name = "TestComponent"; - -let received_type_name = type.type_name.call(type); -let received_short_name = type.short_name.call(type); - - -// assert(type != (), 'Type not found') -// assert(received.type_name == expected.type_name, 'type_name mismatch, expected: ' .. expected.type_name .. ', got: ' .. received.type_name) -// assert(received.short_name == expected.short_name, 'short_name mismatch, expected: ' .. expected.short_name .. ', got: ' .. received.short_name) - -assert(received_type_name == expected_type_name, "type_name mismatch, expected: " + expected_type_name + ", got: " + received_type_name); -assert(received_short_name == expected_short_name, "short_name mismatch, expected: " + expected_short_name + ", got: " + received_short_name); \ No newline at end of file diff --git a/assets/tests/data/globals/dynamic_globals_are_in_scope.rhai b/assets/tests/data/globals/dynamic_globals_are_in_scope.rhai deleted file mode 100644 index 32455f2363..0000000000 --- a/assets/tests/data/globals/dynamic_globals_are_in_scope.rhai +++ /dev/null @@ -1 +0,0 @@ -assert(global_hello_world.call() == "hi!", "global_hello_world() == 'hi!'") \ No newline at end of file diff --git a/assets/tests/data/has_component/empty_entity_mock_component_is_false.rhai b/assets/tests/data/has_component/empty_entity_mock_component_is_false.rhai deleted file mode 100644 index 65aaec5348..0000000000 --- a/assets/tests/data/has_component/empty_entity_mock_component_is_false.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let entity = world.spawn_.call(); -let type = world._get_mock_component_type.call(); - -assert(world.has_component.call(entity, type) == false, "Entity should not have component"); \ No newline at end of file diff --git a/assets/tests/data/has_component/no_component_data.rhai b/assets/tests/data/has_component/no_component_data.rhai deleted file mode 100644 index e5b998e6b6..0000000000 --- a/assets/tests/data/has_component/no_component_data.rhai +++ /dev/null @@ -1,3 +0,0 @@ -let entity = world._get_entity_with_test_component.call("CompWithDefault"); -let component = world.get_type_by_name.call("CompWithDefault"); -assert(world.has_component.call(entity, component) == true, "Component was not found"); \ No newline at end of file diff --git a/assets/tests/data/has_component/with_component_data.rhai b/assets/tests/data/has_component/with_component_data.rhai deleted file mode 100644 index 78240ee203..0000000000 --- a/assets/tests/data/has_component/with_component_data.rhai +++ /dev/null @@ -1,3 +0,0 @@ -let entity = world._get_entity_with_test_component.call("TestComponent"); -let component = world.get_type_by_name.call("TestComponent"); -assert(world.has_component.call(entity, component) == true, "Component was not found"); \ No newline at end of file diff --git a/assets/tests/data/has_resource/existing_no_resource_data.rhai b/assets/tests/data/has_resource/existing_no_resource_data.rhai deleted file mode 100644 index 20c34cb167..0000000000 --- a/assets/tests/data/has_resource/existing_no_resource_data.rhai +++ /dev/null @@ -1,2 +0,0 @@ -let component = world.get_type_by_name.call("ResourceWithDefault"); -assert(world.has_resource.call(component) == true, "Resource was not found"); \ No newline at end of file diff --git a/assets/tests/data/has_resource/existing_with_resource_data.rhai b/assets/tests/data/has_resource/existing_with_resource_data.rhai deleted file mode 100644 index 28a9bf59b1..0000000000 --- a/assets/tests/data/has_resource/existing_with_resource_data.rhai +++ /dev/null @@ -1,2 +0,0 @@ -let component = world.get_type_by_name.call("TestResource"); -assert(world.has_resource.call(component) == true, "Resource was not found"); \ No newline at end of file diff --git a/assets/tests/data/has_resource/missing_resource_mock_resource_is_false.rhai b/assets/tests/data/has_resource/missing_resource_mock_resource_is_false.rhai deleted file mode 100644 index 191aca8f15..0000000000 --- a/assets/tests/data/has_resource/missing_resource_mock_resource_is_false.rhai +++ /dev/null @@ -1,2 +0,0 @@ -let type = world._get_mock_resource_type.call(); -assert(world.has_resource.call(type) == false, "Resource should not exist"); \ No newline at end of file diff --git a/assets/tests/data/hashmap/can_pass_and_return_hashmap.rhai b/assets/tests/data/hashmap/can_pass_and_return_hashmap.rhai deleted file mode 100644 index 60b45a3da4..0000000000 --- a/assets/tests/data/hashmap/can_pass_and_return_hashmap.rhai +++ /dev/null @@ -1,7 +0,0 @@ -let my_map = make_hashmap.call(#{ - key1: 2, - key2: 3, -}); - -assert(my_map["key1"] == 2, "map[\"key1\"] should be 2"); -assert(my_map["key2"] == 3, "map[\"key2\"] should be 3"); \ No newline at end of file diff --git a/assets/tests/data/insert/vec.rhai b/assets/tests/data/insert/vec.rhai deleted file mode 100644 index d5f250418a..0000000000 --- a/assets/tests/data/insert/vec.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -res.vec_usize.insert.call(2, 42); - -assert(res.vec_usize[2] == 42, "insert did not work"); \ No newline at end of file diff --git a/assets/tests/data/insert_children/adding_empty_list_does_nothing.rhai b/assets/tests/data/insert_children/adding_empty_list_does_nothing.rhai deleted file mode 100644 index 85825b47ac..0000000000 --- a/assets/tests/data/insert_children/adding_empty_list_does_nothing.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let entity = world.spawn_.call(); - -world.insert_children.call(entity,0 ,[]); - -assert(world.get_children.call(entity).len == 0); \ No newline at end of file diff --git a/assets/tests/data/insert_children/adds_children_at_correct_index.rhai b/assets/tests/data/insert_children/adds_children_at_correct_index.rhai deleted file mode 100644 index 6c922beb71..0000000000 --- a/assets/tests/data/insert_children/adds_children_at_correct_index.rhai +++ /dev/null @@ -1,8 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); -let child2 = world.spawn_.call(); - -world.insert_children.call(entity, 0, [child]); -world.insert_children.call(entity, 0, [child2]); - -assert(world.get_children.call(entity)[0].index.call() == child2.index.call()); \ No newline at end of file diff --git a/assets/tests/data/insert_children/adds_children_to_existing_enttity.rhai b/assets/tests/data/insert_children/adds_children_to_existing_enttity.rhai deleted file mode 100644 index 5c5a542ad9..0000000000 --- a/assets/tests/data/insert_children/adds_children_to_existing_enttity.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); -let child2 = world.spawn_.call(); -world.insert_children.call(entity, 0, [child, child2]); - -assert(world.get_children.call(entity).len == 2); \ No newline at end of file diff --git a/assets/tests/data/insert_children/invalid_entity_errors.rhai b/assets/tests/data/insert_children/invalid_entity_errors.rhai deleted file mode 100644 index 2b960661ec..0000000000 --- a/assets/tests/data/insert_children/invalid_entity_errors.rhai +++ /dev/null @@ -1,10 +0,0 @@ -let fake_entity = Entity.from_raw.call(9999); - -assert_throws(||{ - world.insert_children.call(fake_entity, 0, [fake_entity]); -}, "Missing or invalid entity"); - -let entity = world.spawn_.call(); -assert_throws(||{ - world.insert_children.call(entity, 0, [fake_entity]); -}, "Missing or invalid entity"); \ No newline at end of file diff --git a/assets/tests/data/insert_component/component_no_default_or_from_world_data_inserts.rhai b/assets/tests/data/insert_component/component_no_default_or_from_world_data_inserts.rhai deleted file mode 100644 index fcf3aa2747..0000000000 --- a/assets/tests/data/insert_component/component_no_default_or_from_world_data_inserts.rhai +++ /dev/null @@ -1,8 +0,0 @@ -let entity = world.spawn_.call(); -let type = world.get_type_by_name.call("TestComponent"); -let entity_with_component = world._get_entity_with_test_component.call("TestComponent"); -let existing_component = world.get_component.call(entity_with_component, type); - -assert(world.has_component.call(entity, type) == false, "Expected entity to not have component before adding, test invalid"); -world.insert_component.call(entity, type, existing_component); -assert(world.has_component.call(entity, type) == true, "Expected entity to have component after adding"); diff --git a/assets/tests/data/insert_component/component_with_default_no_component_data_errors.rhai b/assets/tests/data/insert_component/component_with_default_no_component_data_errors.rhai deleted file mode 100644 index bf2997a115..0000000000 --- a/assets/tests/data/insert_component/component_with_default_no_component_data_errors.rhai +++ /dev/null @@ -1,8 +0,0 @@ -let entity = world.spawn_.call(); -let _type = world.get_type_by_name.call("CompWithDefault"); -let entity_with_component = world._get_entity_with_test_component.call("CompWithDefault"); -let existing_component = world.get_component.call(entity_with_component, _type); - -assert_throws(||{ - world.insert_component.call(entity, _type, existing_component); -}, "Missing type data ReflectComponent for type: .*CompWithDefault.*"); diff --git a/assets/tests/data/iter/vec.rhai b/assets/tests/data/iter/vec.rhai deleted file mode 100644 index accbcd587a..0000000000 --- a/assets/tests/data/iter/vec.rhai +++ /dev/null @@ -1,15 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -let iterated_vals = []; - -for v in res.vec_usize { - iterated_vals.push(v); -} - -assert(iterated_vals.len == 5, "Length is not 5"); -assert(iterated_vals[0] == 1, "First value is not 1"); -assert(iterated_vals[1] == 2, "Second value is not 2"); -assert(iterated_vals[2] == 3, "Third value is not 3"); -assert(iterated_vals[3] == 4, "Fourth value is not 4"); -assert(iterated_vals[4] == 5, "Fifth value is not 5"); diff --git a/assets/tests/data/len/vec.rhai b/assets/tests/data/len/vec.rhai deleted file mode 100644 index b77fecc68c..0000000000 --- a/assets/tests/data/len/vec.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -assert(res.vec_usize.len.call() == 5, "Length is not 5"); \ No newline at end of file diff --git a/assets/tests/data/mod/vec3.rhai b/assets/tests/data/mod/vec3.rhai deleted file mode 100644 index 098425dcfe..0000000000 --- a/assets/tests/data/mod/vec3.rhai +++ /dev/null @@ -1,10 +0,0 @@ -let a = Vec3.new_.call(2.0, 5.0, 6.0); -let b = Vec3.new_.call(1.0, 2.0, 3.0); - -assert((a % 2).x == 0.0, "Modulus did not work"); -assert((a % 2).y == 1.0, "Modulus did not work"); -assert((a % 2).z == 0.0, "Modulus did not work"); - -assert((a % b).x == 0.0, "Modulus did not work"); -assert((a % b).y == 1.0, "Modulus did not work"); -assert((a % b).z == 0.0, "Modulus did not work"); \ No newline at end of file diff --git a/assets/tests/data/mul/vec3.rhai b/assets/tests/data/mul/vec3.rhai deleted file mode 100644 index 5b62477cd7..0000000000 --- a/assets/tests/data/mul/vec3.rhai +++ /dev/null @@ -1,10 +0,0 @@ -let a = Vec3.new_.call(1.0, 2.0, 3.0); -let b = Vec3.new_.call(4.0, 5.0, 6.0); - -assert((a * 2).x == 2.0, "Multiplication did not work"); -assert((a * 2).y == 4.0, "Multiplication did not work"); -assert((a * 2).z == 6.0, "Multiplication did not work"); - -assert((a * b).x == 4.0, "Multiplication did not work"); -assert((a * b).y == 10.0, "Multiplication did not work"); -assert((a * b).z == 18.0, "Multiplication did not work"); \ No newline at end of file diff --git a/assets/tests/data/pop/vec.rhai b/assets/tests/data/pop/vec.rhai deleted file mode 100644 index bf94edb9d2..0000000000 --- a/assets/tests/data/pop/vec.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -let popped = res.vec_usize.pop.call(); - -assert(popped == 5, "Pop did not work"); \ No newline at end of file diff --git a/assets/tests/data/push/vec.rhai b/assets/tests/data/push/vec.rhai deleted file mode 100644 index f6c6c37610..0000000000 --- a/assets/tests/data/push/vec.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -res.vec_usize.push.call(42); - -assert(res.vec_usize[5] == 42, "Push did not work"); \ No newline at end of file diff --git a/assets/tests/data/push_children/adding_empty_list_does_nothing.rhai b/assets/tests/data/push_children/adding_empty_list_does_nothing.rhai deleted file mode 100644 index e4d2905284..0000000000 --- a/assets/tests/data/push_children/adding_empty_list_does_nothing.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let entity = world.spawn_.call(); - -world.push_children.call(entity, []); - -assert(world.get_children.call(entity).len == 0); \ No newline at end of file diff --git a/assets/tests/data/push_children/adds_children_to_existing_enttity.rhai b/assets/tests/data/push_children/adds_children_to_existing_enttity.rhai deleted file mode 100644 index 7c77549edd..0000000000 --- a/assets/tests/data/push_children/adds_children_to_existing_enttity.rhai +++ /dev/null @@ -1,7 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); -let child2 = world.spawn_.call(); - -world.push_children.call(entity, [child, child2]); - -assert(world.get_children.call(entity).len == 2); \ No newline at end of file diff --git a/assets/tests/data/push_children/invalid_entity_errors.rhai b/assets/tests/data/push_children/invalid_entity_errors.rhai deleted file mode 100644 index 15d6ca9501..0000000000 --- a/assets/tests/data/push_children/invalid_entity_errors.rhai +++ /dev/null @@ -1,10 +0,0 @@ -let fake_entity = Entity.from_raw.call(9999); - -assert_throws(||{ - world.push_children.call(fake_entity, [fake_entity]); -}, "Missing or invalid entity"); - -let entity = world.spawn_.call(); -assert_throws(||{ - world.push_children.call(entity, [fake_entity]); -}, "Missing or invalid entity"); \ No newline at end of file diff --git a/assets/tests/data/query/empty_query_returns_nothing.rhai b/assets/tests/data/query/empty_query_returns_nothing.rhai deleted file mode 100644 index ba9293d2d0..0000000000 --- a/assets/tests/data/query/empty_query_returns_nothing.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let component_a = world.get_type_by_name.call("TestComponent"); - -for (result, i) in world.query.call().component.call(component_a).without.call(component_a).build.call() { - assert(false, "This should not be reached"); -} \ No newline at end of file diff --git a/assets/tests/data/query/query_returns_all_entities_matching.rhai b/assets/tests/data/query/query_returns_all_entities_matching.rhai deleted file mode 100644 index 232f5e71d2..0000000000 --- a/assets/tests/data/query/query_returns_all_entities_matching.rhai +++ /dev/null @@ -1,31 +0,0 @@ -let entity_a = world.spawn_.call(); -let entity_b = world.spawn_.call(); -let entity_c = world.spawn_.call(); -let entity_d = world._get_entity_with_test_component.call("CompWithFromWorldAndComponentData"); - -let component_with = world.get_type_by_name.call("CompWithFromWorldAndComponentData"); -let component_without = world.get_type_by_name.call("CompWithDefaultAndComponentData"); - -world.add_default_component.call(entity_a, component_with); -world.add_default_component.call(entity_b, component_with); -world.add_default_component.call(entity_c, component_with); - -world.add_default_component.call(entity_b, component_without); - -let found_entities = []; -for (result, i) in world.query.call().component.call(component_with).without.call(component_without).build.call() { - found_entities.push(result.entity.call()); -} - -assert(found_entities.len == 3, "Expected 3 entities, got " + found_entities.len); - -let expected_entities = [ - entity_d, - entity_a, - entity_c, -]; - -for (entity, i) in found_entities { - assert(entity.index.call() == expected_entities[i].index.call(), "Expected entity " + expected_entities[i].index.call() + " but got " + entity.index.call()); -} - diff --git a/assets/tests/data/remove/vec.rhai b/assets/tests/data/remove/vec.rhai deleted file mode 100644 index 617cc459a3..0000000000 --- a/assets/tests/data/remove/vec.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -let removed = res.vec_usize.remove.call(4); - -assert(removed == 5, "Remove did not work"); diff --git a/assets/tests/data/remove_component/empty_entity_does_nothing.rhai b/assets/tests/data/remove_component/empty_entity_does_nothing.rhai deleted file mode 100644 index c93a8bde4f..0000000000 --- a/assets/tests/data/remove_component/empty_entity_does_nothing.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let entity = world.spawn_.call(); -let type = world.get_type_by_name.call("TestComponent"); - -world.remove_component.call(entity, type); -world.remove_component.call(entity, type); \ No newline at end of file diff --git a/assets/tests/data/remove_component/no_component_data_errors.rhai b/assets/tests/data/remove_component/no_component_data_errors.rhai deleted file mode 100644 index 07f8f714a8..0000000000 --- a/assets/tests/data/remove_component/no_component_data_errors.rhai +++ /dev/null @@ -1,7 +0,0 @@ - -let entity = world._get_entity_with_test_component.call("CompWithDefault"); -let component = world.get_type_by_name.call("CompWithDefault"); - -assert_throws(||{ - world.remove_component.call(entity, component); -}, "Missing type data ReflectComponent for type: .*CompWithDefault.*") diff --git a/assets/tests/data/remove_component/with_component_data_removes_component.rhai b/assets/tests/data/remove_component/with_component_data_removes_component.rhai deleted file mode 100644 index ba8e3967fa..0000000000 --- a/assets/tests/data/remove_component/with_component_data_removes_component.rhai +++ /dev/null @@ -1,5 +0,0 @@ - -let entity = world._get_entity_with_test_component.call("TestComponent"); -let component = world.get_type_by_name.call("TestComponent"); -world.remove_component.call(entity, component); -assert(world.has_component.call(entity, component) == false, "Component was not removed"); diff --git a/assets/tests/data/remove_resource/missing_resource_with_resource_data_does_nothing.rhai b/assets/tests/data/remove_resource/missing_resource_with_resource_data_does_nothing.rhai deleted file mode 100644 index 1ddf844425..0000000000 --- a/assets/tests/data/remove_resource/missing_resource_with_resource_data_does_nothing.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let type = world.get_type_by_name.call("TestResource"); - -world.remove_resource.call(type); -world.remove_resource.call(type); \ No newline at end of file diff --git a/assets/tests/data/remove_resource/no_resource_data_errors.rhai b/assets/tests/data/remove_resource/no_resource_data_errors.rhai deleted file mode 100644 index c69d9dc6d6..0000000000 --- a/assets/tests/data/remove_resource/no_resource_data_errors.rhai +++ /dev/null @@ -1,6 +0,0 @@ - -let type = world._get_mock_resource_type.call(); - -assert_throws(||{ - world.remove_resource.call(type) -}, "Missing type data ReflectResource for type: Unregistered.TypeId.*"); diff --git a/assets/tests/data/remove_resource/with_resource_data_removes_resource.rhai b/assets/tests/data/remove_resource/with_resource_data_removes_resource.rhai deleted file mode 100644 index b8bb4b17a4..0000000000 --- a/assets/tests/data/remove_resource/with_resource_data_removes_resource.rhai +++ /dev/null @@ -1,4 +0,0 @@ - -let type = world.get_type_by_name.call("TestResource"); -world.remove_resource.call(type); -assert(world.has_resource.call(type) == false, "Resource was not removed"); diff --git a/assets/tests/data/set/set_primitives_works.rhai b/assets/tests/data/set/set_primitives_works.rhai deleted file mode 100644 index 820b094b60..0000000000 --- a/assets/tests/data/set/set_primitives_works.rhai +++ /dev/null @@ -1,41 +0,0 @@ -let Resource = world.get_type_by_name.call("TestResourceWithVariousFields"); -let resource = world.get_resource.call(Resource); - -resource.string = "Hello, World!"; -resource.bool = true; -resource.int = 42; -resource.float = 3.0; -resource.vec_usize = [ 1, 2 ]; -resource.string_map = #{ - foo: "string1", - zoo: "string2" -}; - -assert(resource.string == "Hello, World!", "Expected 'Hello, World!', got " + resource.string); -assert(resource.bool == true, "Expected true, got " + resource.bool); -assert(resource.int == 42, "Expected 42, got " + resource.int); -assert(resource.float == 3.0, "Expected 3.14, got " + resource.float); -assert(resource.vec_usize[0] == 1, "Expected 1, got " + resource.vec_usize[1]); -assert(resource.string_map.len.call() == 2, "Expected 2, got " + resource.string_map.len.call()); -// assert(resource.string_map.foo == "string1", "Expected 'string1', got " + resource.string_map.foo); -// assert(resource.string_map.zoo == "string2", "Expected 'string2', got " + resource.string_map.zoo); - -resource.string = "Goodbye, World!"; -resource.bool = false; -resource.int = 24; -resource.float = 1.0; -resource.vec_usize = [ 3, 4 ]; -resource.string_map = #{ - foo: "goodbye", - zoo: "world" -}; - -assert(resource.string == "Goodbye, World!", "Expected 'Goodbye, World!', got " + resource.string); -assert(resource.bool == false, "Expected false, got " + resource.bool); -assert(resource.int == 24, "Expected 24, got " + resource.int); -assert(resource.float == 1.0, "Expected 1.41, got " + resource.float); -assert(resource.vec_usize[0] == 3, "Expected 3, got " + resource.vec_usize[1]); -assert(resource.string_map.len.call() == 2, "Expected 2, got " + resource.string_map.len.call()); -// assert(resource.string_map.foo == "goodbye", "Expected 'goodbye', got " + resource.string_map.foo); -// assert(resource.string_map.zoo == "world", "Expected 'world', got " + resource.string_map.zoo); - diff --git a/assets/tests/data/sub/vec3.rhai b/assets/tests/data/sub/vec3.rhai deleted file mode 100644 index e65d428212..0000000000 --- a/assets/tests/data/sub/vec3.rhai +++ /dev/null @@ -1,11 +0,0 @@ -let a = Vec3.new_.call(1.0, 2.0, 3.0); -let b = Vec3.new_.call(4.0, 5.0, 6.0); - - -assert((a - 1).x == 0.0, "Subtraction did not work"); -assert((a - 1).y == 1.0, "Subtraction did not work"); -assert((a - 1).z == 2.0, "Subtraction did not work"); - -assert((a - b).x == -3.0, "Subtraction did not work"); -assert((a - b).y == -3.0, "Subtraction did not work"); -assert((a - b).z == -3.0, "Subtraction did not work"); \ No newline at end of file diff --git a/assets/tests/data/unm/vec3.rhai b/assets/tests/data/unm/vec3.rhai deleted file mode 100644 index 1104596bf1..0000000000 --- a/assets/tests/data/unm/vec3.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let a = Vec3.new_.call(2.0, -4.0, 6.0); - -assert((-a).x == -2.0, "Negation did not work"); -assert((-a).y == 4.0, "Negation did not work"); -assert((-a).z == -6.0, "Negation did not work"); \ No newline at end of file diff --git a/assets/tests/rhai/access/multiple_read_refs.rhai b/assets/tests/rhai/access/multiple_read_refs.rhai deleted file mode 100644 index 875e8eff06..0000000000 --- a/assets/tests/rhai/access/multiple_read_refs.rhai +++ /dev/null @@ -1,3 +0,0 @@ -let entity = Entity.from_raw.call(9999); -// does not throw -let out = entity.eq.call(entity); \ No newline at end of file diff --git a/assets/tests/rhai/add/vec3.rhai b/assets/tests/rhai/add/vec3.rhai deleted file mode 100644 index c538e36e29..0000000000 --- a/assets/tests/rhai/add/vec3.rhai +++ /dev/null @@ -1,11 +0,0 @@ -let a = Vec3.new_.call(1.0, 2.0, 3.0); -let b = Vec3.new_.call(4.0, 5.0, 6.0); - -assert((a + 1).x == 2.0, "Addition did not work"); -assert((a + 1).y == 3.0, "Addition did not work"); -assert((a + 1).z == 4.0, "Addition did not work"); - -assert((a + b).x == 5.0, "Addition did not work"); -assert((a + b).y == 7.0, "Addition did not work"); -assert((a + b).z == 9.0, "Addition did not work"); - diff --git a/assets/tests/rhai/add_default_component/component_no_default_or_from_world_data_errors.rhai b/assets/tests/rhai/add_default_component/component_no_default_or_from_world_data_errors.rhai deleted file mode 100644 index 463d3100c0..0000000000 --- a/assets/tests/rhai/add_default_component/component_no_default_or_from_world_data_errors.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let entity = world.spawn_.call(); -let type = world.get_type_by_name.call("TestComponent"); - -assert_throws(||{ - world.add_default_component.call(entity, type); -},"Missing type data ReflectDefault or ReflectFromWorld for type: .*TestComponent.*"); \ No newline at end of file diff --git a/assets/tests/rhai/add_default_component/component_with_default_and_component_data_adds_default.rhai b/assets/tests/rhai/add_default_component/component_with_default_and_component_data_adds_default.rhai deleted file mode 100644 index e2ce895868..0000000000 --- a/assets/tests/rhai/add_default_component/component_with_default_and_component_data_adds_default.rhai +++ /dev/null @@ -1,9 +0,0 @@ -let entity = world.spawn_.call(); -let _type = world.get_type_by_name.call("CompWithDefaultAndComponentData"); -world.add_default_component.call(entity, _type); - -let added = world.has_component.call(entity, _type); -assert(type_of(added) != "()", "Component not added"); - -let component = world.get_component.call(entity, _type); -assert(component["_0"] == "Default", "Component did not have default value, got: " + component["_0"]); \ No newline at end of file diff --git a/assets/tests/rhai/add_default_component/component_with_default_no_component_data_errors.rhai b/assets/tests/rhai/add_default_component/component_with_default_no_component_data_errors.rhai deleted file mode 100644 index 988642e16c..0000000000 --- a/assets/tests/rhai/add_default_component/component_with_default_no_component_data_errors.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let entity = world.spawn_.call(); -let _type = world.get_type_by_name.call("CompWithDefault"); - -assert_throws(||{ - world.add_default_component.call(entity, _type); -}, "Missing type data ReflectComponent for type: .*CompWithDefault.*") diff --git a/assets/tests/rhai/add_default_component/component_with_from_world_and_component_data_adds_default.rhai b/assets/tests/rhai/add_default_component/component_with_from_world_and_component_data_adds_default.rhai deleted file mode 100644 index 63c81f3dec..0000000000 --- a/assets/tests/rhai/add_default_component/component_with_from_world_and_component_data_adds_default.rhai +++ /dev/null @@ -1,9 +0,0 @@ -let entity = world.spawn_.call(); -let _type = world.get_type_by_name.call("CompWithFromWorldAndComponentData"); -world.add_default_component.call(entity, _type); - -let added = world.has_component.call(entity, _type); -assert(type_of(added) != "()", "Component not added"); - -let component = world.get_component.call(entity, _type); -assert(component["_0"] == "Default", "Component did not have default value, got: " + component["_0"]) \ No newline at end of file diff --git a/assets/tests/rhai/add_default_component/component_with_from_world_no_component_data_errors.rhai b/assets/tests/rhai/add_default_component/component_with_from_world_no_component_data_errors.rhai deleted file mode 100644 index 323dfb84d1..0000000000 --- a/assets/tests/rhai/add_default_component/component_with_from_world_no_component_data_errors.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let entity = world.spawn_.call(); -let _type = world.get_type_by_name.call("CompWithFromWorld"); - -assert_throws(||{ - world.add_default_component.call(entity, _type); -}, "Missing type data ReflectComponent for type: .*CompWithFromWorld.*") \ No newline at end of file diff --git a/assets/tests/rhai/api_availability/api_available_on_callback.rhai b/assets/tests/rhai/api_availability/api_available_on_callback.rhai deleted file mode 100644 index d37af11858..0000000000 --- a/assets/tests/rhai/api_availability/api_available_on_callback.rhai +++ /dev/null @@ -1,5 +0,0 @@ -fn on_test() { - assert!(type_of(world) != "()", "World was not found"); - assert!(type_of(world.get_type_by_name.call("TestComponent")) != "()", "Could not find TestComponent type"); - Entity.from_raw.call(1); -} \ No newline at end of file diff --git a/assets/tests/rhai/api_availability/api_available_on_script_load.rhai b/assets/tests/rhai/api_availability/api_available_on_script_load.rhai deleted file mode 100644 index 5661f55644..0000000000 --- a/assets/tests/rhai/api_availability/api_available_on_script_load.rhai +++ /dev/null @@ -1,3 +0,0 @@ -assert!(type_of(world) != "()", "World was not found"); -assert!(type_of(world.get_type_by_name.call("TestComponent")) != "()", "Could not find TestComponent type"); -let out = Entity.from_raw.call(1); \ No newline at end of file diff --git a/assets/tests/rhai/clear/vec.rhai b/assets/tests/rhai/clear/vec.rhai deleted file mode 100644 index 4f1d5e7d10..0000000000 --- a/assets/tests/rhai/clear/vec.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -res.vec_usize.clear.call(); - -assert(res.vec_usize.len.call() == 0, "Clear did not work"); \ No newline at end of file diff --git a/assets/tests/rhai/construct/simple_enum.rhai b/assets/tests/rhai/construct/simple_enum.rhai deleted file mode 100644 index 463de1f9a7..0000000000 --- a/assets/tests/rhai/construct/simple_enum.rhai +++ /dev/null @@ -1,18 +0,0 @@ -let type = world.get_type_by_name.call("SimpleEnum"); - -// Struct Variant -let constructed = construct.call(type, #{ variant: "Struct", foo: 123 }); - -assert(constructed.variant_name.call() == "Struct", "Value was constructed incorrectly, expected constructed.variant to be Struct but got " + constructed.variant_name.call()); -assert(constructed.foo == 123, "Value was constructed incorrectly, expected constructed.foo to be 123 but got " + constructed.foo); - -// TupleStruct Variant -constructed = construct.call(type, #{ variant: "TupleStruct", "_0": 123 }); - -assert(constructed.variant_name.call() == "TupleStruct", "Value was constructed incorrectly, expected constructed.variant to be TupleStruct but got " + constructed.variant_name.call()); -assert(constructed["_0"] == 123, "Value was constructed incorrectly, expected constructed._0 to be 123 but got " + constructed["_0"]); - -// Unit Variant -constructed = construct.call(type, #{ variant: "Unit" }); - -assert(constructed.variant_name.call() == "Unit", "Value was constructed incorrectly, expected constructed.variant to be Unit but got " + constructed.variant_name.call()); \ No newline at end of file diff --git a/assets/tests/rhai/construct/simple_struct.rhai b/assets/tests/rhai/construct/simple_struct.rhai deleted file mode 100644 index e35edbddd2..0000000000 --- a/assets/tests/rhai/construct/simple_struct.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let type = world.get_type_by_name.call("SimpleStruct"); -let constructed = construct.call(type, #{ foo: 123 }); - -assert(constructed.foo == 123, "Value was constructed incorrectly, expected constructed.foo to be 123 but got " + constructed.foo); \ No newline at end of file diff --git a/assets/tests/rhai/construct/simple_tuple_struct.rhai b/assets/tests/rhai/construct/simple_tuple_struct.rhai deleted file mode 100644 index 411b3e806f..0000000000 --- a/assets/tests/rhai/construct/simple_tuple_struct.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let type = world.get_type_by_name.call("SimpleTupleStruct"); -let constructed = construct.call(type, #{ "_0": 123 }); - -assert(constructed["_0"] == 123, "Value was constructed incorrectly, expected constructed.foo to be 123 but got " + constructed["_0"]); \ No newline at end of file diff --git a/assets/tests/rhai/despawn/despawns_only_root.rhai b/assets/tests/rhai/despawn/despawns_only_root.rhai deleted file mode 100644 index 5c3a8fc466..0000000000 --- a/assets/tests/rhai/despawn/despawns_only_root.rhai +++ /dev/null @@ -1,7 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); -world.push_children.call(entity, [child]); -world.despawn.call(entity); - -assert(world.has_entity.call(entity) == false, "Parent should be despawned"); -assert(world.has_entity.call(child) == true, "Child should not be despawned"); diff --git a/assets/tests/rhai/despawn/invalid_entity_errors.rhai b/assets/tests/rhai/despawn/invalid_entity_errors.rhai deleted file mode 100644 index 730fca0782..0000000000 --- a/assets/tests/rhai/despawn/invalid_entity_errors.rhai +++ /dev/null @@ -1,3 +0,0 @@ -assert_throws(||{ - world.despawn_recursive.call(Entity.from_raw.call(9999)) -}, "Missing or invalid entity"); \ No newline at end of file diff --git a/assets/tests/rhai/despawn_descendants/despawns_only_child.rhai b/assets/tests/rhai/despawn_descendants/despawns_only_child.rhai deleted file mode 100644 index fb6996cee4..0000000000 --- a/assets/tests/rhai/despawn_descendants/despawns_only_child.rhai +++ /dev/null @@ -1,7 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); -world.push_children.call(entity, [child]); -world.despawn_descendants.call(entity); - -assert(world.has_entity.call(entity) == true, "Parent should not be despawned"); -assert(world.has_entity.call(child) == false, "Child should be despawned"); diff --git a/assets/tests/rhai/despawn_descendants/invalid_entity_errors.rhai b/assets/tests/rhai/despawn_descendants/invalid_entity_errors.rhai deleted file mode 100644 index bdaa98ff33..0000000000 --- a/assets/tests/rhai/despawn_descendants/invalid_entity_errors.rhai +++ /dev/null @@ -1,3 +0,0 @@ -assert_throws(||{ - world.despawn_recursive.call(Entity.from_raw.call(9999)); -}, "Missing or invalid entity") \ No newline at end of file diff --git a/assets/tests/rhai/despawn_recursive/despawns_recursively.rhai b/assets/tests/rhai/despawn_recursive/despawns_recursively.rhai deleted file mode 100644 index 8d4e2ab757..0000000000 --- a/assets/tests/rhai/despawn_recursive/despawns_recursively.rhai +++ /dev/null @@ -1,7 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); -world.push_children.call(entity, [child]); -world.despawn_recursive.call(entity); - -assert(world.has_entity.call(entity) == false, "Parent should be despawned"); -assert(world.has_entity.call(child) == false, "Child should be despawned"); diff --git a/assets/tests/rhai/despawn_recursive/invalid_entity_errors.rhai b/assets/tests/rhai/despawn_recursive/invalid_entity_errors.rhai deleted file mode 100644 index bdaa98ff33..0000000000 --- a/assets/tests/rhai/despawn_recursive/invalid_entity_errors.rhai +++ /dev/null @@ -1,3 +0,0 @@ -assert_throws(||{ - world.despawn_recursive.call(Entity.from_raw.call(9999)); -}, "Missing or invalid entity") \ No newline at end of file diff --git a/assets/tests/rhai/div/vec3.rhai b/assets/tests/rhai/div/vec3.rhai deleted file mode 100644 index af3a96d5f0..0000000000 --- a/assets/tests/rhai/div/vec3.rhai +++ /dev/null @@ -1,10 +0,0 @@ -let a = Vec3.new_.call(2.0, 4.0, 6.0); -let b = Vec3.new_.call(1.0, 2.0, 3.0); - -assert((a / 2).x == 1.0, "Division did not work"); -assert((a / 2).y == 2.0, "Division did not work"); -assert((a / 2).z == 3.0, "Division did not work"); - -assert((a / b).x == 2.0, "Division did not work"); -assert((a / b).y == 2.0, "Division did not work"); -assert((a / b).z == 2.0, "Division did not work"); \ No newline at end of file diff --git a/assets/tests/rhai/eq/vec3.rhai b/assets/tests/rhai/eq/vec3.rhai deleted file mode 100644 index f4652fed8c..0000000000 --- a/assets/tests/rhai/eq/vec3.rhai +++ /dev/null @@ -1,7 +0,0 @@ -let a = Vec3.new_.call(2.0, -4.0, 6.0); -let b = Vec3.new_.call(4.0, 5.0, 6.0); - - -assert((a == b) == false, "Equality did not work"); -assert((a != b) == true, "Inequality did not work"); -assert((a == a) == true, "Equality did not work"); \ No newline at end of file diff --git a/assets/tests/rhai/functions/contains_reflect_reference_functions.rhai b/assets/tests/rhai/functions/contains_reflect_reference_functions.rhai deleted file mode 100644 index f83b980c99..0000000000 --- a/assets/tests/rhai/functions/contains_reflect_reference_functions.rhai +++ /dev/null @@ -1,14 +0,0 @@ - -let Resource = world.get_type_by_name.call("TestResource"); -let resource = world.get_resource.call(Resource); - -let functions = resource.functions.call(); -assert(functions.len() > 0, "functions should not be empty"); - -let available_names = []; - -for function_ref in functions { - available_names.push(function_ref.name); -} - -assert("display_ref" in available_names, "functions should contain display_ref, but got: " + available_names); \ No newline at end of file diff --git a/assets/tests/rhai/get_children/has_children_returns_them.rhai b/assets/tests/rhai/get_children/has_children_returns_them.rhai deleted file mode 100644 index 1f8bece3a4..0000000000 --- a/assets/tests/rhai/get_children/has_children_returns_them.rhai +++ /dev/null @@ -1,9 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); - -world.push_children.call(entity, [child]); - -let children = world.get_children.call(entity); - -assert(children.len == 1, "Expected 1 child"); -assert(children[0].index.call() == child.index.call(), "Child is the wrong entity"); \ No newline at end of file diff --git a/assets/tests/rhai/get_children/invalid_entity_errors.rhai b/assets/tests/rhai/get_children/invalid_entity_errors.rhai deleted file mode 100644 index 90bf506ca9..0000000000 --- a/assets/tests/rhai/get_children/invalid_entity_errors.rhai +++ /dev/null @@ -1,3 +0,0 @@ -assert_throws(||{ - world.get_children.call(Entity.from_raw.call(9999)); -}, "Missing or invalid entity"); diff --git a/assets/tests/rhai/get_children/no_children_returns_empty_table.rhai b/assets/tests/rhai/get_children/no_children_returns_empty_table.rhai deleted file mode 100644 index 1ecc14c5a0..0000000000 --- a/assets/tests/rhai/get_children/no_children_returns_empty_table.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let entity = world.spawn_.call(); -let children = world.get_children.call(entity); - -assert(children.len == 0); \ No newline at end of file diff --git a/assets/tests/rhai/get_component/component_no_component_data.rhai b/assets/tests/rhai/get_component/component_no_component_data.rhai deleted file mode 100644 index 1000055921..0000000000 --- a/assets/tests/rhai/get_component/component_no_component_data.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let component = world.get_type_by_name.call("CompWithDefault"); -let entity = world._get_entity_with_test_component.call("CompWithDefault"); -let retrieved = world.get_component.call(entity, component); - -assert(type_of(retrieved) != "()", "Component was not found"); -assert(retrieved["_0"] == "Initial Value", "Component data was not retrieved correctly, retrieved._0 was: " + retrieved["_0"]); \ No newline at end of file diff --git a/assets/tests/rhai/get_component/component_with_component_data.rhai b/assets/tests/rhai/get_component/component_with_component_data.rhai deleted file mode 100644 index 7a638c20ea..0000000000 --- a/assets/tests/rhai/get_component/component_with_component_data.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let component = world.get_type_by_name.call("TestComponent"); -let entity = world._get_entity_with_test_component.call("TestComponent"); -let retrieved = world.get_component.call(entity, component); - -assert(type_of(retrieved) != "()", "Component was not found"); -assert(retrieved.strings[0] == "Initial", "Component data was not retrieved correctly, retrieved.strings[0] was: " + retrieved.strings[0]); \ No newline at end of file diff --git a/assets/tests/rhai/get_component/empty_entity_component_with_component_data.rhai b/assets/tests/rhai/get_component/empty_entity_component_with_component_data.rhai deleted file mode 100644 index 42c4abc0f1..0000000000 --- a/assets/tests/rhai/get_component/empty_entity_component_with_component_data.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let component = world.get_type_by_name.call("TestComponent"); -let entity = world.spawn_.call(); -let retrieved = world.get_component.call(entity, component); - -assert(type_of(retrieved) == "()", "Component found"); \ No newline at end of file diff --git a/assets/tests/rhai/get_parent/has_parent_returns_it.rhai b/assets/tests/rhai/get_parent/has_parent_returns_it.rhai deleted file mode 100644 index a992e6068c..0000000000 --- a/assets/tests/rhai/get_parent/has_parent_returns_it.rhai +++ /dev/null @@ -1,9 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); - -world.push_children.call(entity, [child]); - -let parent = world.get_parent.call(child); - -assert(type_of(parent) != "()", "Expected a parent"); -assert(parent.index.call() == entity.index.call(), "Parent is the wrong entity"); \ No newline at end of file diff --git a/assets/tests/rhai/get_parent/invalid_entity_errors.rhai b/assets/tests/rhai/get_parent/invalid_entity_errors.rhai deleted file mode 100644 index b25d0981df..0000000000 --- a/assets/tests/rhai/get_parent/invalid_entity_errors.rhai +++ /dev/null @@ -1,4 +0,0 @@ - -assert_throws(||{ - world.get_parent.call(Entity.from_raw.call(9999)); -}, "Missing or invalid entity"); diff --git a/assets/tests/rhai/get_parent/no_parent_returns_nil.rhai b/assets/tests/rhai/get_parent/no_parent_returns_nil.rhai deleted file mode 100644 index d4abc7d2d5..0000000000 --- a/assets/tests/rhai/get_parent/no_parent_returns_nil.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let entity = world.spawn_.call(); -let parent = world.get_parent.call(entity); - -assert(type_of(parent) == "()", "Expected no parents"); diff --git a/assets/tests/rhai/get_resource/missing_resource_returns_nil.rhai b/assets/tests/rhai/get_resource/missing_resource_returns_nil.rhai deleted file mode 100644 index e127d1a958..0000000000 --- a/assets/tests/rhai/get_resource/missing_resource_returns_nil.rhai +++ /dev/null @@ -1,2 +0,0 @@ -let type = world._get_mock_resource_type.call(); -assert(type_of(world.get_resource.call(type)) == "()", "Resource should not exist"); \ No newline at end of file diff --git a/assets/tests/rhai/get_resource/no_resource_data_returns_resource.rhai b/assets/tests/rhai/get_resource/no_resource_data_returns_resource.rhai deleted file mode 100644 index 3c172e5ac3..0000000000 --- a/assets/tests/rhai/get_resource/no_resource_data_returns_resource.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let resource = world.get_type_by_name.call("ResourceWithDefault"); - -let retrieved = world.get_resource.call(resource); -assert(type_of(retrieved) != "()", "Resource should exist"); -assert(retrieved["_0"] == "Initial Value", "Resource should have default value but got: " + retrieved["_0"]); diff --git a/assets/tests/rhai/get_resource/with_resource_data_returns_resource.rhai b/assets/tests/rhai/get_resource/with_resource_data_returns_resource.rhai deleted file mode 100644 index c0f657d6b8..0000000000 --- a/assets/tests/rhai/get_resource/with_resource_data_returns_resource.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let resource = world.get_type_by_name.call("TestResource"); - -let retrieved = world.get_resource.call(resource); -assert(type_of(retrieved) != "()", "Resource should exist"); -assert(retrieved.bytes[1] == 1, "Resource should have default value but got resource with #retrieved.bytes[1]: " + retrieved.bytes[1]); diff --git a/assets/tests/rhai/get_type_by_name/missing_type_returns_nothing.rhai b/assets/tests/rhai/get_type_by_name/missing_type_returns_nothing.rhai deleted file mode 100644 index 2ac4944019..0000000000 --- a/assets/tests/rhai/get_type_by_name/missing_type_returns_nothing.rhai +++ /dev/null @@ -1,3 +0,0 @@ -let type = world.get_type_by_name.call("MissingType"); - -assert(type == (), "Unregistered type was found"); diff --git a/assets/tests/rhai/get_type_by_name/registered_type_returns_correct_type.rhai b/assets/tests/rhai/get_type_by_name/registered_type_returns_correct_type.rhai deleted file mode 100644 index 00f5379b8a..0000000000 --- a/assets/tests/rhai/get_type_by_name/registered_type_returns_correct_type.rhai +++ /dev/null @@ -1,17 +0,0 @@ -let type = world.get_type_by_name.call("TestComponent"); - -assert(type_of(type) != "()", "Registered type was not found"); - -let expected_type_name = "test_utils::test_data::TestComponent"; -let expected_short_name = "TestComponent"; - -let received_type_name = type.type_name.call(type); -let received_short_name = type.short_name.call(type); - - -// assert(type != (), 'Type not found') -// assert(received.type_name == expected.type_name, 'type_name mismatch, expected: ' .. expected.type_name .. ', got: ' .. received.type_name) -// assert(received.short_name == expected.short_name, 'short_name mismatch, expected: ' .. expected.short_name .. ', got: ' .. received.short_name) - -assert(received_type_name == expected_type_name, "type_name mismatch, expected: " + expected_type_name + ", got: " + received_type_name); -assert(received_short_name == expected_short_name, "short_name mismatch, expected: " + expected_short_name + ", got: " + received_short_name); \ No newline at end of file diff --git a/assets/tests/rhai/globals/dynamic_globals_are_in_scope.rhai b/assets/tests/rhai/globals/dynamic_globals_are_in_scope.rhai deleted file mode 100644 index 32455f2363..0000000000 --- a/assets/tests/rhai/globals/dynamic_globals_are_in_scope.rhai +++ /dev/null @@ -1 +0,0 @@ -assert(global_hello_world.call() == "hi!", "global_hello_world() == 'hi!'") \ No newline at end of file diff --git a/assets/tests/rhai/has_component/empty_entity_mock_component_is_false.rhai b/assets/tests/rhai/has_component/empty_entity_mock_component_is_false.rhai deleted file mode 100644 index 65aaec5348..0000000000 --- a/assets/tests/rhai/has_component/empty_entity_mock_component_is_false.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let entity = world.spawn_.call(); -let type = world._get_mock_component_type.call(); - -assert(world.has_component.call(entity, type) == false, "Entity should not have component"); \ No newline at end of file diff --git a/assets/tests/rhai/has_component/no_component_data.rhai b/assets/tests/rhai/has_component/no_component_data.rhai deleted file mode 100644 index e5b998e6b6..0000000000 --- a/assets/tests/rhai/has_component/no_component_data.rhai +++ /dev/null @@ -1,3 +0,0 @@ -let entity = world._get_entity_with_test_component.call("CompWithDefault"); -let component = world.get_type_by_name.call("CompWithDefault"); -assert(world.has_component.call(entity, component) == true, "Component was not found"); \ No newline at end of file diff --git a/assets/tests/rhai/has_component/with_component_data.rhai b/assets/tests/rhai/has_component/with_component_data.rhai deleted file mode 100644 index 78240ee203..0000000000 --- a/assets/tests/rhai/has_component/with_component_data.rhai +++ /dev/null @@ -1,3 +0,0 @@ -let entity = world._get_entity_with_test_component.call("TestComponent"); -let component = world.get_type_by_name.call("TestComponent"); -assert(world.has_component.call(entity, component) == true, "Component was not found"); \ No newline at end of file diff --git a/assets/tests/rhai/has_resource/existing_no_resource_data.rhai b/assets/tests/rhai/has_resource/existing_no_resource_data.rhai deleted file mode 100644 index 20c34cb167..0000000000 --- a/assets/tests/rhai/has_resource/existing_no_resource_data.rhai +++ /dev/null @@ -1,2 +0,0 @@ -let component = world.get_type_by_name.call("ResourceWithDefault"); -assert(world.has_resource.call(component) == true, "Resource was not found"); \ No newline at end of file diff --git a/assets/tests/rhai/has_resource/existing_with_resource_data.rhai b/assets/tests/rhai/has_resource/existing_with_resource_data.rhai deleted file mode 100644 index 28a9bf59b1..0000000000 --- a/assets/tests/rhai/has_resource/existing_with_resource_data.rhai +++ /dev/null @@ -1,2 +0,0 @@ -let component = world.get_type_by_name.call("TestResource"); -assert(world.has_resource.call(component) == true, "Resource was not found"); \ No newline at end of file diff --git a/assets/tests/rhai/has_resource/missing_resource_mock_resource_is_false.rhai b/assets/tests/rhai/has_resource/missing_resource_mock_resource_is_false.rhai deleted file mode 100644 index 191aca8f15..0000000000 --- a/assets/tests/rhai/has_resource/missing_resource_mock_resource_is_false.rhai +++ /dev/null @@ -1,2 +0,0 @@ -let type = world._get_mock_resource_type.call(); -assert(world.has_resource.call(type) == false, "Resource should not exist"); \ No newline at end of file diff --git a/assets/tests/rhai/hashmap/can_pass_and_return_hashmap.rhai b/assets/tests/rhai/hashmap/can_pass_and_return_hashmap.rhai deleted file mode 100644 index 60b45a3da4..0000000000 --- a/assets/tests/rhai/hashmap/can_pass_and_return_hashmap.rhai +++ /dev/null @@ -1,7 +0,0 @@ -let my_map = make_hashmap.call(#{ - key1: 2, - key2: 3, -}); - -assert(my_map["key1"] == 2, "map[\"key1\"] should be 2"); -assert(my_map["key2"] == 3, "map[\"key2\"] should be 3"); \ No newline at end of file diff --git a/assets/tests/rhai/insert/vec.rhai b/assets/tests/rhai/insert/vec.rhai deleted file mode 100644 index d5f250418a..0000000000 --- a/assets/tests/rhai/insert/vec.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -res.vec_usize.insert.call(2, 42); - -assert(res.vec_usize[2] == 42, "insert did not work"); \ No newline at end of file diff --git a/assets/tests/rhai/insert_children/adding_empty_list_does_nothing.rhai b/assets/tests/rhai/insert_children/adding_empty_list_does_nothing.rhai deleted file mode 100644 index 85825b47ac..0000000000 --- a/assets/tests/rhai/insert_children/adding_empty_list_does_nothing.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let entity = world.spawn_.call(); - -world.insert_children.call(entity,0 ,[]); - -assert(world.get_children.call(entity).len == 0); \ No newline at end of file diff --git a/assets/tests/rhai/insert_children/adds_children_at_correct_index.rhai b/assets/tests/rhai/insert_children/adds_children_at_correct_index.rhai deleted file mode 100644 index 6c922beb71..0000000000 --- a/assets/tests/rhai/insert_children/adds_children_at_correct_index.rhai +++ /dev/null @@ -1,8 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); -let child2 = world.spawn_.call(); - -world.insert_children.call(entity, 0, [child]); -world.insert_children.call(entity, 0, [child2]); - -assert(world.get_children.call(entity)[0].index.call() == child2.index.call()); \ No newline at end of file diff --git a/assets/tests/rhai/insert_children/adds_children_to_existing_enttity.rhai b/assets/tests/rhai/insert_children/adds_children_to_existing_enttity.rhai deleted file mode 100644 index 5c5a542ad9..0000000000 --- a/assets/tests/rhai/insert_children/adds_children_to_existing_enttity.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); -let child2 = world.spawn_.call(); -world.insert_children.call(entity, 0, [child, child2]); - -assert(world.get_children.call(entity).len == 2); \ No newline at end of file diff --git a/assets/tests/rhai/insert_children/invalid_entity_errors.rhai b/assets/tests/rhai/insert_children/invalid_entity_errors.rhai deleted file mode 100644 index 2b960661ec..0000000000 --- a/assets/tests/rhai/insert_children/invalid_entity_errors.rhai +++ /dev/null @@ -1,10 +0,0 @@ -let fake_entity = Entity.from_raw.call(9999); - -assert_throws(||{ - world.insert_children.call(fake_entity, 0, [fake_entity]); -}, "Missing or invalid entity"); - -let entity = world.spawn_.call(); -assert_throws(||{ - world.insert_children.call(entity, 0, [fake_entity]); -}, "Missing or invalid entity"); \ No newline at end of file diff --git a/assets/tests/rhai/insert_component/component_no_default_or_from_world_data_inserts.rhai b/assets/tests/rhai/insert_component/component_no_default_or_from_world_data_inserts.rhai deleted file mode 100644 index fcf3aa2747..0000000000 --- a/assets/tests/rhai/insert_component/component_no_default_or_from_world_data_inserts.rhai +++ /dev/null @@ -1,8 +0,0 @@ -let entity = world.spawn_.call(); -let type = world.get_type_by_name.call("TestComponent"); -let entity_with_component = world._get_entity_with_test_component.call("TestComponent"); -let existing_component = world.get_component.call(entity_with_component, type); - -assert(world.has_component.call(entity, type) == false, "Expected entity to not have component before adding, test invalid"); -world.insert_component.call(entity, type, existing_component); -assert(world.has_component.call(entity, type) == true, "Expected entity to have component after adding"); diff --git a/assets/tests/rhai/insert_component/component_with_default_no_component_data_errors.rhai b/assets/tests/rhai/insert_component/component_with_default_no_component_data_errors.rhai deleted file mode 100644 index bf2997a115..0000000000 --- a/assets/tests/rhai/insert_component/component_with_default_no_component_data_errors.rhai +++ /dev/null @@ -1,8 +0,0 @@ -let entity = world.spawn_.call(); -let _type = world.get_type_by_name.call("CompWithDefault"); -let entity_with_component = world._get_entity_with_test_component.call("CompWithDefault"); -let existing_component = world.get_component.call(entity_with_component, _type); - -assert_throws(||{ - world.insert_component.call(entity, _type, existing_component); -}, "Missing type data ReflectComponent for type: .*CompWithDefault.*"); diff --git a/assets/tests/rhai/iter/vec.rhai b/assets/tests/rhai/iter/vec.rhai deleted file mode 100644 index accbcd587a..0000000000 --- a/assets/tests/rhai/iter/vec.rhai +++ /dev/null @@ -1,15 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -let iterated_vals = []; - -for v in res.vec_usize { - iterated_vals.push(v); -} - -assert(iterated_vals.len == 5, "Length is not 5"); -assert(iterated_vals[0] == 1, "First value is not 1"); -assert(iterated_vals[1] == 2, "Second value is not 2"); -assert(iterated_vals[2] == 3, "Third value is not 3"); -assert(iterated_vals[3] == 4, "Fourth value is not 4"); -assert(iterated_vals[4] == 5, "Fifth value is not 5"); diff --git a/assets/tests/rhai/len/vec.rhai b/assets/tests/rhai/len/vec.rhai deleted file mode 100644 index b77fecc68c..0000000000 --- a/assets/tests/rhai/len/vec.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -assert(res.vec_usize.len.call() == 5, "Length is not 5"); \ No newline at end of file diff --git a/assets/tests/rhai/mod/vec3.rhai b/assets/tests/rhai/mod/vec3.rhai deleted file mode 100644 index 098425dcfe..0000000000 --- a/assets/tests/rhai/mod/vec3.rhai +++ /dev/null @@ -1,10 +0,0 @@ -let a = Vec3.new_.call(2.0, 5.0, 6.0); -let b = Vec3.new_.call(1.0, 2.0, 3.0); - -assert((a % 2).x == 0.0, "Modulus did not work"); -assert((a % 2).y == 1.0, "Modulus did not work"); -assert((a % 2).z == 0.0, "Modulus did not work"); - -assert((a % b).x == 0.0, "Modulus did not work"); -assert((a % b).y == 1.0, "Modulus did not work"); -assert((a % b).z == 0.0, "Modulus did not work"); \ No newline at end of file diff --git a/assets/tests/rhai/mul/vec3.rhai b/assets/tests/rhai/mul/vec3.rhai deleted file mode 100644 index 5b62477cd7..0000000000 --- a/assets/tests/rhai/mul/vec3.rhai +++ /dev/null @@ -1,10 +0,0 @@ -let a = Vec3.new_.call(1.0, 2.0, 3.0); -let b = Vec3.new_.call(4.0, 5.0, 6.0); - -assert((a * 2).x == 2.0, "Multiplication did not work"); -assert((a * 2).y == 4.0, "Multiplication did not work"); -assert((a * 2).z == 6.0, "Multiplication did not work"); - -assert((a * b).x == 4.0, "Multiplication did not work"); -assert((a * b).y == 10.0, "Multiplication did not work"); -assert((a * b).z == 18.0, "Multiplication did not work"); \ No newline at end of file diff --git a/assets/tests/rhai/pop/vec.rhai b/assets/tests/rhai/pop/vec.rhai deleted file mode 100644 index bf94edb9d2..0000000000 --- a/assets/tests/rhai/pop/vec.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -let popped = res.vec_usize.pop.call(); - -assert(popped == 5, "Pop did not work"); \ No newline at end of file diff --git a/assets/tests/rhai/push/vec.rhai b/assets/tests/rhai/push/vec.rhai deleted file mode 100644 index f6c6c37610..0000000000 --- a/assets/tests/rhai/push/vec.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -res.vec_usize.push.call(42); - -assert(res.vec_usize[5] == 42, "Push did not work"); \ No newline at end of file diff --git a/assets/tests/rhai/push_children/adding_empty_list_does_nothing.rhai b/assets/tests/rhai/push_children/adding_empty_list_does_nothing.rhai deleted file mode 100644 index e4d2905284..0000000000 --- a/assets/tests/rhai/push_children/adding_empty_list_does_nothing.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let entity = world.spawn_.call(); - -world.push_children.call(entity, []); - -assert(world.get_children.call(entity).len == 0); \ No newline at end of file diff --git a/assets/tests/rhai/push_children/adds_children_to_existing_enttity.rhai b/assets/tests/rhai/push_children/adds_children_to_existing_enttity.rhai deleted file mode 100644 index 7c77549edd..0000000000 --- a/assets/tests/rhai/push_children/adds_children_to_existing_enttity.rhai +++ /dev/null @@ -1,7 +0,0 @@ -let entity = world.spawn_.call(); -let child = world.spawn_.call(); -let child2 = world.spawn_.call(); - -world.push_children.call(entity, [child, child2]); - -assert(world.get_children.call(entity).len == 2); \ No newline at end of file diff --git a/assets/tests/rhai/push_children/invalid_entity_errors.rhai b/assets/tests/rhai/push_children/invalid_entity_errors.rhai deleted file mode 100644 index 15d6ca9501..0000000000 --- a/assets/tests/rhai/push_children/invalid_entity_errors.rhai +++ /dev/null @@ -1,10 +0,0 @@ -let fake_entity = Entity.from_raw.call(9999); - -assert_throws(||{ - world.push_children.call(fake_entity, [fake_entity]); -}, "Missing or invalid entity"); - -let entity = world.spawn_.call(); -assert_throws(||{ - world.push_children.call(entity, [fake_entity]); -}, "Missing or invalid entity"); \ No newline at end of file diff --git a/assets/tests/rhai/query/empty_query_returns_nothing.rhai b/assets/tests/rhai/query/empty_query_returns_nothing.rhai deleted file mode 100644 index ba9293d2d0..0000000000 --- a/assets/tests/rhai/query/empty_query_returns_nothing.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let component_a = world.get_type_by_name.call("TestComponent"); - -for (result, i) in world.query.call().component.call(component_a).without.call(component_a).build.call() { - assert(false, "This should not be reached"); -} \ No newline at end of file diff --git a/assets/tests/rhai/query/query_returns_all_entities_matching.rhai b/assets/tests/rhai/query/query_returns_all_entities_matching.rhai deleted file mode 100644 index 232f5e71d2..0000000000 --- a/assets/tests/rhai/query/query_returns_all_entities_matching.rhai +++ /dev/null @@ -1,31 +0,0 @@ -let entity_a = world.spawn_.call(); -let entity_b = world.spawn_.call(); -let entity_c = world.spawn_.call(); -let entity_d = world._get_entity_with_test_component.call("CompWithFromWorldAndComponentData"); - -let component_with = world.get_type_by_name.call("CompWithFromWorldAndComponentData"); -let component_without = world.get_type_by_name.call("CompWithDefaultAndComponentData"); - -world.add_default_component.call(entity_a, component_with); -world.add_default_component.call(entity_b, component_with); -world.add_default_component.call(entity_c, component_with); - -world.add_default_component.call(entity_b, component_without); - -let found_entities = []; -for (result, i) in world.query.call().component.call(component_with).without.call(component_without).build.call() { - found_entities.push(result.entity.call()); -} - -assert(found_entities.len == 3, "Expected 3 entities, got " + found_entities.len); - -let expected_entities = [ - entity_d, - entity_a, - entity_c, -]; - -for (entity, i) in found_entities { - assert(entity.index.call() == expected_entities[i].index.call(), "Expected entity " + expected_entities[i].index.call() + " but got " + entity.index.call()); -} - diff --git a/assets/tests/rhai/remove/vec.rhai b/assets/tests/rhai/remove/vec.rhai deleted file mode 100644 index 617cc459a3..0000000000 --- a/assets/tests/rhai/remove/vec.rhai +++ /dev/null @@ -1,6 +0,0 @@ -let res_type = world.get_type_by_name.call("TestResourceWithVariousFields"); -let res = world.get_resource.call(res_type); - -let removed = res.vec_usize.remove.call(4); - -assert(removed == 5, "Remove did not work"); diff --git a/assets/tests/rhai/remove_component/empty_entity_does_nothing.rhai b/assets/tests/rhai/remove_component/empty_entity_does_nothing.rhai deleted file mode 100644 index c93a8bde4f..0000000000 --- a/assets/tests/rhai/remove_component/empty_entity_does_nothing.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let entity = world.spawn_.call(); -let type = world.get_type_by_name.call("TestComponent"); - -world.remove_component.call(entity, type); -world.remove_component.call(entity, type); \ No newline at end of file diff --git a/assets/tests/rhai/remove_component/no_component_data_errors.rhai b/assets/tests/rhai/remove_component/no_component_data_errors.rhai deleted file mode 100644 index 07f8f714a8..0000000000 --- a/assets/tests/rhai/remove_component/no_component_data_errors.rhai +++ /dev/null @@ -1,7 +0,0 @@ - -let entity = world._get_entity_with_test_component.call("CompWithDefault"); -let component = world.get_type_by_name.call("CompWithDefault"); - -assert_throws(||{ - world.remove_component.call(entity, component); -}, "Missing type data ReflectComponent for type: .*CompWithDefault.*") diff --git a/assets/tests/rhai/remove_component/with_component_data_removes_component.rhai b/assets/tests/rhai/remove_component/with_component_data_removes_component.rhai deleted file mode 100644 index ba8e3967fa..0000000000 --- a/assets/tests/rhai/remove_component/with_component_data_removes_component.rhai +++ /dev/null @@ -1,5 +0,0 @@ - -let entity = world._get_entity_with_test_component.call("TestComponent"); -let component = world.get_type_by_name.call("TestComponent"); -world.remove_component.call(entity, component); -assert(world.has_component.call(entity, component) == false, "Component was not removed"); diff --git a/assets/tests/rhai/remove_resource/missing_resource_with_resource_data_does_nothing.rhai b/assets/tests/rhai/remove_resource/missing_resource_with_resource_data_does_nothing.rhai deleted file mode 100644 index 1ddf844425..0000000000 --- a/assets/tests/rhai/remove_resource/missing_resource_with_resource_data_does_nothing.rhai +++ /dev/null @@ -1,4 +0,0 @@ -let type = world.get_type_by_name.call("TestResource"); - -world.remove_resource.call(type); -world.remove_resource.call(type); \ No newline at end of file diff --git a/assets/tests/rhai/remove_resource/no_resource_data_errors.rhai b/assets/tests/rhai/remove_resource/no_resource_data_errors.rhai deleted file mode 100644 index c69d9dc6d6..0000000000 --- a/assets/tests/rhai/remove_resource/no_resource_data_errors.rhai +++ /dev/null @@ -1,6 +0,0 @@ - -let type = world._get_mock_resource_type.call(); - -assert_throws(||{ - world.remove_resource.call(type) -}, "Missing type data ReflectResource for type: Unregistered.TypeId.*"); diff --git a/assets/tests/rhai/remove_resource/with_resource_data_removes_resource.rhai b/assets/tests/rhai/remove_resource/with_resource_data_removes_resource.rhai deleted file mode 100644 index b8bb4b17a4..0000000000 --- a/assets/tests/rhai/remove_resource/with_resource_data_removes_resource.rhai +++ /dev/null @@ -1,4 +0,0 @@ - -let type = world.get_type_by_name.call("TestResource"); -world.remove_resource.call(type); -assert(world.has_resource.call(type) == false, "Resource was not removed"); diff --git a/assets/tests/rhai/set/set_primitives_works.rhai b/assets/tests/rhai/set/set_primitives_works.rhai deleted file mode 100644 index 8ae0d6d4e8..0000000000 --- a/assets/tests/rhai/set/set_primitives_works.rhai +++ /dev/null @@ -1,28 +0,0 @@ -let Resource = world.get_type_by_name.call("TestResourceWithVariousFields"); -let resource = world.get_resource.call(Resource); - -resource.string = "Hello, World!"; -resource.bool = true; -resource.int = 42; -resource.float = 3.0; -resource.vec_usize = [ 1, 2 ]; - -assert(resource.string == "Hello, World!", "Expected 'Hello, World!', got " + resource.string); -assert(resource.bool == true, "Expected true, got " + resource.bool); -assert(resource.int == 42, "Expected 42, got " + resource.int); -assert(resource.float == 3.0, "Expected 3.14, got " + resource.float); -assert(resource.vec_usize[0] == 1, "Expected 1, got " + resource.vec_usize[1]); - -resource.string = "Goodbye, World!"; -resource.bool = false; -resource.int = 24; -resource.float = 1.0; -resource.vec_usize = [ 3, 4 ]; - -assert(resource.string == "Goodbye, World!", "Expected 'Goodbye, World!', got " + resource.string); -assert(resource.bool == false, "Expected false, got " + resource.bool); -assert(resource.int == 24, "Expected 24, got " + resource.int); -assert(resource.float == 1.0, "Expected 1.41, got " + resource.float); -assert(resource.vec_usize[0] == 3, "Expected 3, got " + resource.vec_usize[1]); - - diff --git a/assets/tests/rhai/sub/vec3.rhai b/assets/tests/rhai/sub/vec3.rhai deleted file mode 100644 index e65d428212..0000000000 --- a/assets/tests/rhai/sub/vec3.rhai +++ /dev/null @@ -1,11 +0,0 @@ -let a = Vec3.new_.call(1.0, 2.0, 3.0); -let b = Vec3.new_.call(4.0, 5.0, 6.0); - - -assert((a - 1).x == 0.0, "Subtraction did not work"); -assert((a - 1).y == 1.0, "Subtraction did not work"); -assert((a - 1).z == 2.0, "Subtraction did not work"); - -assert((a - b).x == -3.0, "Subtraction did not work"); -assert((a - b).y == -3.0, "Subtraction did not work"); -assert((a - b).z == -3.0, "Subtraction did not work"); \ No newline at end of file diff --git a/assets/tests/rhai/unm/vec3.rhai b/assets/tests/rhai/unm/vec3.rhai deleted file mode 100644 index 1104596bf1..0000000000 --- a/assets/tests/rhai/unm/vec3.rhai +++ /dev/null @@ -1,5 +0,0 @@ -let a = Vec3.new_.call(2.0, -4.0, 6.0); - -assert((-a).x == -2.0, "Negation did not work"); -assert((-a).y == 4.0, "Negation did not work"); -assert((-a).z == -6.0, "Negation did not work"); \ No newline at end of file