2 releases

0.1.0-alpha.2 Oct 20, 2024
0.1.0-alpha.1 Aug 22, 2024

#353 in Testing

Download history 24/week @ 2024-09-11 17/week @ 2024-09-18 13/week @ 2024-09-25 23/week @ 2024-10-02 7/week @ 2024-10-09 162/week @ 2024-10-16 28/week @ 2024-10-23 13/week @ 2024-10-30 14/week @ 2024-11-06 27/week @ 2024-11-13 39/week @ 2024-11-20 25/week @ 2024-11-27 33/week @ 2024-12-04 81/week @ 2024-12-11 25/week @ 2024-12-18 12/week @ 2024-12-25

154 downloads per month

MIT/Apache

14KB
192 lines

proc-macro-tester

Macros for testing procedural macros.

Only attribute macros are supported at the moment.

Examples

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,
        }
    }
);

License

Licensed under either of

at your option.

Contribution

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.

Dependencies

~84KB