Skip to content

Commit 8c16d8c

Browse files
committed
Add lua test API and add pass more tests
1 parent 8a36f8f commit 8c16d8c

File tree

13 files changed

+3536
-3499
lines changed

13 files changed

+3536
-3499
lines changed

crates/bevy_api_gen/templates/mod.tera

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![cfg_attr(rustfmt, rustfmt_skip)]
55
{% filter prettyplease %}
66
{%- for crate in crates %}
7-
pub(crate) mod {{ crate.name }};
7+
pub mod {{ crate.name }};
88
{% endfor -%}
99

1010
pub struct {{ api_name }};

crates/languages/bevy_mod_scripting_lua/src/bindings/providers/bevy_ecs.rs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ pub struct OnReplace {}
159159
bms_lua_path = "crate",
160160
functions[r#"
161161
162+
#[lua(as_trait = "std::clone::Clone")]
163+
fn clone(
164+
_self: LuaReflectRefProxy<bevy::ecs::component::ComponentId>,
165+
) -> LuaReflectValProxy<bevy::ecs::component::ComponentId>;
166+
167+
"#,
168+
r#"
169+
162170
#[lua(
163171
as_trait = "std::cmp::PartialEq::<bevy::ecs::component::ComponentId>",
164172
composite = "eq",
@@ -168,6 +176,14 @@ pub struct OnReplace {}
168176
other: LuaReflectRefProxy<bevy::ecs::component::ComponentId>,
169177
) -> bool;
170178
179+
"#,
180+
r#"
181+
182+
#[lua(as_trait = "std::cmp::Eq")]
183+
fn assert_receiver_is_total_eq(
184+
_self: LuaReflectRefProxy<bevy::ecs::component::ComponentId>,
185+
) -> ();
186+
171187
"#,
172188
r#"
173189
/// Creates a new [`ComponentId`].
@@ -184,22 +200,6 @@ pub struct OnReplace {}
184200
#[lua()]
185201
fn index(_self: LuaReflectValProxy<bevy::ecs::component::ComponentId>) -> usize;
186202
187-
"#,
188-
r#"
189-
190-
#[lua(as_trait = "std::clone::Clone")]
191-
fn clone(
192-
_self: LuaReflectRefProxy<bevy::ecs::component::ComponentId>,
193-
) -> LuaReflectValProxy<bevy::ecs::component::ComponentId>;
194-
195-
"#,
196-
r#"
197-
198-
#[lua(as_trait = "std::cmp::Eq")]
199-
fn assert_receiver_is_total_eq(
200-
_self: LuaReflectRefProxy<bevy::ecs::component::ComponentId>,
201-
) -> ();
202-
203203
"#,
204204
r#"
205205
#[lua(metamethod="ToString")]
@@ -216,26 +216,6 @@ pub struct ComponentId();
216216
bms_lua_path = "crate",
217217
functions[r#"
218218
219-
#[lua(as_trait = "std::cmp::Eq")]
220-
fn assert_receiver_is_total_eq(
221-
_self: LuaReflectRefProxy<bevy::ecs::component::Tick>,
222-
) -> ();
223-
224-
"#,
225-
r#"
226-
227-
#[lua(
228-
as_trait = "std::cmp::PartialEq::<bevy::ecs::component::Tick>",
229-
composite = "eq",
230-
)]
231-
fn eq(
232-
_self: LuaReflectRefProxy<bevy::ecs::component::Tick>,
233-
other: LuaReflectRefProxy<bevy::ecs::component::Tick>,
234-
) -> bool;
235-
236-
"#,
237-
r#"
238-
239219
#[lua(as_trait = "std::clone::Clone")]
240220
fn clone(
241221
_self: LuaReflectRefProxy<bevy::ecs::component::Tick>,
@@ -274,6 +254,26 @@ pub struct ComponentId();
274254
this_run: LuaReflectValProxy<bevy::ecs::component::Tick>,
275255
) -> bool;
276256
257+
"#,
258+
r#"
259+
260+
#[lua(as_trait = "std::cmp::Eq")]
261+
fn assert_receiver_is_total_eq(
262+
_self: LuaReflectRefProxy<bevy::ecs::component::Tick>,
263+
) -> ();
264+
265+
"#,
266+
r#"
267+
268+
#[lua(
269+
as_trait = "std::cmp::PartialEq::<bevy::ecs::component::Tick>",
270+
composite = "eq",
271+
)]
272+
fn eq(
273+
_self: LuaReflectRefProxy<bevy::ecs::component::Tick>,
274+
other: LuaReflectRefProxy<bevy::ecs::component::Tick>,
275+
) -> bool;
276+
277277
"#,
278278
r#"
279279
#[lua(metamethod="ToString")]

crates/languages/bevy_mod_scripting_lua/src/bindings/providers/bevy_hierarchy.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,6 @@ pub struct Parent();
7979
bms_lua_path = "crate",
8080
functions[r#"
8181
82-
#[lua(as_trait = "std::cmp::Eq")]
83-
fn assert_receiver_is_total_eq(
84-
_self: LuaReflectRefProxy<bevy::hierarchy::HierarchyEvent>,
85-
) -> ();
86-
87-
"#,
88-
r#"
89-
9082
#[lua(
9183
as_trait = "std::cmp::PartialEq::<bevy::hierarchy::HierarchyEvent>",
9284
composite = "eq",
@@ -104,6 +96,14 @@ pub struct Parent();
10496
_self: LuaReflectRefProxy<bevy::hierarchy::HierarchyEvent>,
10597
) -> LuaReflectValProxy<bevy::hierarchy::HierarchyEvent>;
10698
99+
"#,
100+
r#"
101+
102+
#[lua(as_trait = "std::cmp::Eq")]
103+
fn assert_receiver_is_total_eq(
104+
_self: LuaReflectRefProxy<bevy::hierarchy::HierarchyEvent>,
105+
) -> ();
106+
107107
"#,
108108
r#"
109109
#[lua(metamethod="ToString")]

0 commit comments

Comments
 (0)