Skip to content

Inline snapshots with trailing commas are not recognized by insta review #772

@ErickHdez96

Description

@ErickHdez96

What happened?

When adding a trailing comma in an inline snapshot @"",, the diff is correctly shown when the test fails, but `cargo insta review reports that there are no more snaphots to review.

Reproduction steps

  1. Add an inline snapshot test with a trailing comma @"",.
fn foo(x: i8) -> i8 { x }

#[test]
fn it_does_not_work() {
    insta::assert_snapshot!(foo(8), @"",);
}

#[test]
fn it_works() {
    insta::assert_snapshot!(foo(8), @"8");
}
  1. Run cargo test. Diff is correctly shown.
  2. Run cargo insta review. Insta reports: done: no snapshots to review

Insta Version

insta = "1.43.1"

rustc Version

rustc 1.86.0

What did you expect?

Either an error message that trailing commas are not allowed in that context, or to be able to review the snapshot of the failed test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions