[Rust] Add gen-name-strings for Rust (#5757)

* Add gen-name-strings for Rust

* Clang format

* Add tests and generate with gen-name-strings

* Clang-format

* Stop doing gen-name-strings with C++ code

* Bring generate_code.bat up with generate_code.sh
This commit is contained in:
Lee Mracek
2020-03-08 22:05:20 -04:00
committed by GitHub
parent f73d205bc7
commit 5a98d65e86
6 changed files with 78 additions and 3 deletions

View File

@@ -2875,6 +2875,18 @@ mod copy_clone_traits {
}
}
#[cfg(test)]
mod fully_qualified_name {
#[test]
fn fully_qualified_name_generated() {
assert!(check_eq!(::my_game::example::Monster::get_fully_qualified_name(), "MyGame.Example.Monster").is_ok());
assert!(check_eq!(::my_game::example_2::Monster::get_fully_qualified_name(), "MyGame.Example2.Monster").is_ok());
assert!(check_eq!(::my_game::example::Vec3::get_fully_qualified_name(), "MyGame.Example.Vec3").is_ok());
assert!(check_eq!(::my_game::example::Ability::get_fully_qualified_name(), "MyGame.Example.Ability").is_ok());
}
}
// this is not technically a test, but we want to always keep this generated
// file up-to-date, and the simplest way to do that is to make sure that when
// tests are run, the file is generated.