eupn / macrotest

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

Feature Request: Expand fail #65

Open Emoun opened 3 years ago

Emoun commented 3 years ago

Hi,

I want to ask whether you would consider implementing what trybuild essentially does, I.e. allowing us to check that a compilation fails with a given error message?

The reason I ask is that I'm in need of the functionality that trybuild provides, however it is missing essential features that macrotest has. Most essential is the fact that it doesn't seem to panic upon wrong test results, which is a deal-breaker for me. Also, features that have been implemented in macrotest are also missing (#41,#43). Additionally, it seems silly to me that I would need to use two different crates for two functions that are so similar.

Essentially what I would need is expand_fail versions of expand and expand_without_refresh, that expects the expansion to fail and then checks the error message is as expected. If the expansion doesn't fail, or the error message is wrong, the test is a failure.

Emoun commented 3 years ago

The trybuild crate has just rejected a feature request that is essential for duplicate (dtolnay/trybuild#108), making it all the more useful if macrotest could provide a more fully featured alternative to trybuild.

eupn commented 3 years ago

@Emoun, on it