Crates.io | proc-macro-tester |
lib.rs | proc-macro-tester |
version | 0.1.0-alpha.2 |
source | src |
created_at | 2024-08-22 13:45:43.836444 |
updated_at | 2024-10-20 04:05:32.154181 |
description | Macros for testing procedural macros |
homepage | |
repository | https://codeberg.org/supnas/proc-macro-tester |
max_upload_size | |
id | 1347714 |
size | 24,998 |
Macros for testing procedural macros.
Only attribute macros are supported at the moment.
use proc_macro_tester::{assert_expands, assert_yields};
assert_expands!(
{
#[add_id_field(u32)]
struct Person {
name: String,
}
},
{
struct Person {
id: u32,
name: String,
}
}
);
assert_yields!(
{
#[create_struct_without_id(NewPerson)]
struct Person {
id: u32,
name: String,
}
},
{
struct NewPerson {
name: String,
}
}
);
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.