You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, after removing the insta::assert_snapshot!() from there, using cargo insta test still crashes:
$ RUST_BACKTRACE=1 cargo insta test --release
thread 'main' panicked at 'assertion failed: self.inline_snapshots.last().map_or(true, |x| x.end.0 <= line)', /home/sam/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-insta-1.26.0/src/inline.rs:60:17
stack backtrace:
0: rust_begin_unwind
at /rustc/1e4f90061cc4bc566f99ab21b1f101182b10cf0c/library/std/src/panicking.rs:575:5
1: core::panicking::panic_fmt
at /rustc/1e4f90061cc4bc566f99ab21b1f101182b10cf0c/library/core/src/panicking.rs:64:14
2: core::panicking::panic
at /rustc/1e4f90061cc4bc566f99ab21b1f101182b10cf0c/library/core/src/panicking.rs:114:5
3: cargo_insta::inline::FilePatcher::add_snapshot_macro
4: cargo_insta::container::SnapshotContainer::load
5: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
6: <core::iter::adapters::filter_map::FilterMap<I,F> as core::iter::traits::iterator::Iterator>::try_fold
7: cargo_insta::cli::load_snapshot_containers
8: cargo_insta::cli::process_snapshots
9: cargo_insta::cli::run
10: cargo_insta::main
Reproduction steps
Put a insta::snapshot!() in a loop or a shared function.
Run cargo insta test and get an assertion error.
Remove the problematic insta::snapshot!().
Run cargo insta test and get another assertion error. At this stage you cannot use cargo insta anymore (unless you remove the pending snap file by hand)
Insta Version
1.26.0
rustc Version
rustc 1.69.0-nightly (e972bc808 2023-01-29)
What did you expect?
cargo insta test should work again when the problematic insta::assert_snapshot!() is removed from source.
The text was updated successfully, but these errors were encountered:
What happened?
After I put a
insta::assert_snapshot!()
in a function called by several tests, I got the expectedintroduced after #307.
However, after removing the
insta::assert_snapshot!()
from there, usingcargo insta test
still crashes:Reproduction steps
insta::snapshot!()
in a loop or a shared function.cargo insta test
and get an assertion error.insta::snapshot!()
.cargo insta test
and get another assertion error. At this stage you cannot usecargo insta
anymore (unless you remove the pending snap file by hand)Insta Version
1.26.0
rustc Version
rustc 1.69.0-nightly (e972bc808 2023-01-29)
What did you expect?
cargo insta test
should work again when the problematicinsta::assert_snapshot!()
is removed from source.The text was updated successfully, but these errors were encountered: