-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #419 from fpdotmonkey/alias-class-definitions
Allow different class names in rust and Godot
- Loading branch information
Showing
5 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
use crate::framework::itest; | ||
use godot::prelude::*; | ||
|
||
pub mod dont_rename { | ||
use super::*; | ||
|
||
#[derive(GodotClass)] | ||
pub struct RepeatMe {} | ||
} | ||
|
||
pub mod rename { | ||
use super::*; | ||
|
||
#[derive(GodotClass)] | ||
#[class(rename = NoRepeat)] | ||
pub struct RepeatMe {} | ||
} | ||
|
||
#[itest] | ||
fn renaming_changes_the_name() { | ||
assert_ne!( | ||
dont_rename::RepeatMe::class_name(), | ||
rename::RepeatMe::class_name() | ||
); | ||
assert_eq!(dont_rename::RepeatMe::class_name().as_str(), "RepeatMe"); | ||
assert_eq!(rename::RepeatMe::class_name().as_str(), "NoRepeat"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
*/ | ||
|
||
mod base_test; | ||
mod class_rename_test; | ||
mod object_test; | ||
mod property_test; | ||
mod singleton_test; | ||
|