Use `cgp-macro-test-util` for snapshot testing CGP macros
mainThe cgp-macro-test-util crate provides a family of snapshot_*! procedural macros designed to pin the code generated by core CGP macros.
When you use a snapshot macro, it performs two simultaneous actions:
- Emits the real generated code: It expands the underlying CGP macro into the module exactly as it would in production. This ensures that traits, structs, and implementations remain live so you can still write tests against their runtime behavior.
- Generates a
#[test]: It creates a test function that asserts a pretty-printed string of that same expansion against an inlineinstasnapshot.
This allows you to verify that macro expansions remain stable without breaking the compile-time or runtime coverage of your code.