Skip to content

Commit

Permalink
Property GDScript test: rename property_ -> var_
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Aug 4, 2024
1 parent c48e74c commit 5fbde3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions itest/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ fn generate_property_template(inputs: &[Input]) -> PropertyTests {
continue;
}

let property = format_ident!("property_{ident}");
let property_array = format_ident!("property_array_{ident}");
let var = format_ident!("var_{ident}");
let var_array = format_ident!("var_array_{ident}");
let export = format_ident!("export_{ident}");
let export_array = format_ident!("export_array_{ident}");

Expand All @@ -427,14 +427,14 @@ fn generate_property_template(inputs: &[Input]) -> PropertyTests {
quote! {
#[var]
#initializer
#property: #rust_ty
#var: #rust_ty
},
quote! { #[var] #property_array: Array<#rust_ty> },
quote! { #[var] #var_array: Array<#rust_ty> },
]);

gdscript.extend([
format!("var {property}: {gdscript_ty}"),
format!("var {property_array}: Array[{gdscript_ty}]"),
format!("var {var}: {gdscript_ty}"),
format!("var {var_array}: Array[{gdscript_ty}]"),
]);

if *is_exportable {
Expand Down
4 changes: 2 additions & 2 deletions itest/rust/src/object_tests/property_template_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ fn property_template_test(ctx: &TestContext) {
// For now, just ignore array properties when we compile for 4.1 but run in 4.2.
if GdextBuild::since_api("4.2")
&& cfg!(before_api = "4.2")
&& name.starts_with("property_array_")
&& name.starts_with("var_array_")
{
continue;
}

if name.starts_with("property_") || name.starts_with("export_") {
if name.starts_with("var_") || name.starts_with("export_") {
properties.insert(name, property);
}
}
Expand Down

0 comments on commit 5fbde3b

Please sign in to comment.