rust-analyzer / expect-test

Minimalistic snapshot testing for Rust.
Apache License 2.0
248 stars 22 forks source link

Macro-less variant #15

Open matklad opened 3 years ago

matklad commented 3 years ago
#[track_caller]
pub fn expect(data: [&str; 1]) -> Expect

seems like this can work?

bjorn3 commented 3 years ago

That would give confusing results if the caller has #[track_caller] too.

matklad commented 3 years ago

Good question, macros and Location::caller indeed behave differently in this respect: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=62145393b803fce3564f805a1d3c4493