eupn / macrotest

Test harness for declarative and procedural macros expansion via `cargo-expand`
49 stars 9 forks source link

Wrong report when macro expansion fails #67

Open Emoun opened 2 years ago

Emoun commented 2 years ago

For all macrotest::expand variants, if the macro being expanded panics, the report gives wrong or confusing errors.

First, if you have no .expanded file and not using expand_without_refresh, the call will succeed (even though the expanded macro panicked) and create an empty .expanded file. If you are using expand_without_refresh the report will correctly show an error however will give no indication about what happened.

If you do have an .expanded file the report will give a <file-path> - different! error, and show the contents of your expanded file but nothing else.

For all of these cases, I would expect the error message to tell me that the macro expansion failed and maybe show me the error message it failed with.

Note: I found these cases while testing #66, however, these problems are also present in v1.0.8.