snapbox
Snapshot testing toolbox
1.2.2
11M downloads/mo
#2897 most downloaded on crates.io
assert-rs/snapbox
What this package is like to depend on
Last release 2 months ago
26 May 2026
Ships unpredictably
gaps range from 8 days to 10 months
Most releases are documented
notes for 67 of 80 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
80 releases · first in 2022
10 releases in the last 12 months
see the full history below
Release timeline
80 releases · Mar 2022 to May 2026Releases
latest 60 of 80-
1.2.226 May 2026 -
1.2.102 Apr 2026 -
1.2.023 Mar 2026 -
1.1.010 Mar 2026Release notes
Open source →Compatibility
- Change
cmd::cargo_binbad paths to panics
Features
- Add
cmd::cargo_bins - Add
cmd::cargo_bin_opt
- Change
-
1.0.210 Mar 2026 -
1.0.103 Mar 2026 -
1.0.011 Feb 2026Nothing published for this version
-
0.6.2409 Jan 2026Release notes
Open source →Fixes
- Update
fn cargo_bin()to use the upcoming runtimeCARGO_BIN_EXE_* - Add
#[must_use]toCommand::assertto ensure assertions are ade
- Update
-
0.6.2329 Oct 2025Nothing published for this version
-
0.6.2215 Oct 2025Release notes
Open source →Fixes
- Allow additional nesting of extensions when inferring data formats from a path
Compatibility
- Bump MSRV to 1.66
-
0.6.2116 Dec 2024 -
0.6.2007 Nov 2024 -
0.6.1929 Oct 2024 -
0.6.1804 Oct 2024Release notes
Open source →Fixes
- Take redactions into account when finding the end of an elided structured, unordered array
-
0.6.1714 Aug 2024Release notes
Open source →Fixes
- Take redactions into account when finding the end of an elided structured array
-
0.6.1625 Jul 2024Nothing published for this version
-
0.6.1524 Jul 2024 -
0.6.1423 Jul 2024Release notes
Open source →Compatibility
- Deprecated
IntoData::jsonin favor ofIntoData::is_json - Deprecated
IntoData::json_linesin favor ofIntoData::is_jsonlines - Deprecated
IntoData::term_svgin favor ofIntoData::is_termsvg
Features
- Added
IntoData::against, with shortcuts forjsonandjsonlines, for differentactualandexpectedformats
- Deprecated
-
0.6.1312 Jul 2024Nothing published for this version
-
0.6.1210 Jul 2024Nothing published for this version
-
0.6.1110 Jul 2024Release notes
Open source →Fixes
str![]: fail, rather than panic, on divergent overlapping overwrites
-
0.6.1010 Jun 2024 -
0.6.907 Jun 2024 -
0.6.807 Jun 2024 -
0.6.729 May 2024 -
0.6.629 May 2024 -
0.6.527 May 2024Release notes
Open source →Fixes
- Don't stop
.term.svgredactions just because the document widths are different
- Don't stop
-
0.6.425 May 2024 -
0.6.324 May 2024Release notes
Open source →Fixes
- Make diff headers consistent line str's showing relative paths like file-backed expected
-
0.6.224 May 2024Release notes
Open source →Compatibility
- Deprecated
Assert::substitutionsin favor ofAssert::redact_with
- Deprecated
-
0.6.124 May 2024 -
0.6.023 May 2024Release notes
Open source →Compatibility
Breaking
- Removed deprecated functionality
- Removed
str![[]]indent support - Added trailing newline to
str![[]] - Made
DataFormatfuture-proof .../[..]processing has been tweaked- Redactions no longer normalize the value (except the new
Pathredactions) - Change
FilterRedactionsintoNormalizedToExpected
Other
- Deprecate
eq_fn's in favor ofeq
Features
- jsonlines support
- Regex redactions
Pathredactions- Json "all keys" wildcard support
- Unordered lines / json array support
Fixes
- Handle more cases with
... - Be smarter about which redactions are processed first
- Redact json values on mismatch
- Filter and redact json keys
-
0.5.1423 May 2024Release notes
Open source →Compatibility
- Deprecated
filter::NormalizePathsin favor offilter::FilterPaths - Deprecated
filter::NormalizeNewlinesin favor offilter::FilterNewlines
- Deprecated
-
0.5.1321 May 2024 -
0.5.1217 May 2024 -
0.5.1117 May 2024Release notes
Open source →Compatibility
- Deprecated
Assert::eq(expected, actual)in favor ofAssert::eq_(actual, expected.raw()) - Deprecated
Assert::matches(expected, actual)in favor ofAssert::eq_(actual, expected) - Deprecated
OutputAssert::stdout_eq(expected, actual)in favor ofOutputAssert::stdout_eq_(actual, expected.raw()) - Deprecated
OutputAssert::stdout_matches(expected, actual)in favor ofOutputAssert::stdout_eq_(actual, expected) - Deprecated
OutputAssert::stderr_eq(expected, actual)in favor ofOutputAssert::stderr_eq_(actual, expected.raw()) - Deprecated
OutputAssert::stderr_matches(expected, actual)in favor ofOutputAssert::stderr_eq_(actual, expected) - Deprecated
data::Data::normalizein favor offilter::Filter::filter - Deprecated
data::Normalize::normalizein favor offilter::Filter::filter - Deprecated
data::NormalizeNewlinesin favor offilter::NormalizeNewlines - Deprecated
data::NormalizePathsin favor offilter::NormalizePaths - Deprecated
data::NormalizeMatchesin favor offilter::FilterRedactions - Deprecated
data::Substitutionsin favor offilter::Redactions - Deprecated
pathfeature / mod in favor ofdirfeature / mod - Deprecated
path::PathFixturein favor ofdir::DirRoot - Deprecated
Errorin favor ofassert::Error - Deprecated
Resultin favor ofassert::Result - Deprecated
Actionin favor ofassert::Action - Deprecated
DEFAULT_ACTION_ENVin favor ofassert::DEFAULT_ACTION_ENV - Deprecated
utils::normalize_linesin favor offilter::normalize_lines - Deprecated
utils::normalize_pathsin favor offilter::normalize_paths - Deprecated
utils::normalize_text
Features
- Add
Assert::eq_(actual, expected) - Add
OutputAssert::stdout_eq_(actual, expected) - Add
OutputAssert::stderr_eq_(actual, expected) - Add
assert_data_eq!(actual, expected) - Add
preludefor easier access toIntoData,IntoJson, andToDebug - Add
IntoDatafor easier data conversions - Add
IntoJsonfor easier data conversions - Add
Data::rawto disable filters on expected values - Add
Harness::with_assertfor greater customization - Add
Assert::try_eqfor non-panicking asserts - Add
Assert::selected_actionto see whats chosen
- Deprecated
-
0.5.1015 May 2024Nothing published for this version
-
0.5.913 Mar 2024Release notes
Open source →Fixes
- Don't strip on
str![].indent(false)to work with lines with indentation
- Don't strip on
-
0.5.801 Mar 2024 -
0.5.727 Feb 2024Release notes
Open source →Fixes
- Respect
Assert::normalize_paths(false)when runningsubset_matches
- Respect
-
0.5.622 Feb 2024 -
0.5.522 Feb 2024Nothing published for this version
-
0.5.422 Feb 2024Nothing published for this version
-
0.5.322 Feb 2024Release notes
Open source →Fixes
- (term-svg) Correctly coerce "actual" to this type on when the snapshot doesn't yet exist
- (term-svg) Ignore irrelevant details when checking for failuress
- (term-svg) Don't show irrelevant details in the diff
-
0.5.219 Feb 2024Release notes
Open source →Features
- Add
term-svgfeature for snapshotting of terminal styling by ending files with.term.svg
- Add
-
0.5.115 Feb 2024Release notes
Open source →Fixes
- Fixed regression where you couldn't overwrite a snapshot that doesn't exist yet
-
0.5.014 Feb 2024Release notes
Open source →Breaking Change
_pathassertions have been replaced by regular assertions accepting and updatingData::read_from/file![]- Renamed
Data::try_coercetoData::coerce_to - Normalization types and
DataFormatwere moved to thedatamod
Features
str![]macro for inline snapshotscoerce_tofor specifying the structure of the snapshot
file!["<path-relative-to-rs>"]macro for test-relative snapshots_placeholder can be used for auto-generated file names: Json(seeDataFormat) type ascriptions for specifying the structure of the snapshot
ToDebugextension trait for easier snapshot testing of debug output- Help catch swapped parameters to assertions by panicking if the "actual" has a source to update but not the "expected"
- Allow inserting multiple values for the same variable, to handle multiple forms of the same value (like UNC paths vs regular paths)
path::current_rs!()macro for an absolute path ofstd::fs::file!path::current_dir!()macro to get the absolute path tostd::fs::file!path::cargo_rustc_current_dir()macro as a polyfill for the unstableCARGO_RUSTC_CURRENT_DIR
-
0.4.1708 Feb 2024Nothing published for this version
-
0.4.1612 Jan 2024 -
0.4.1508 Dec 2023 -
0.4.1402 Oct 2023 -
0.4.1328 Sep 2023 -
0.4.1224 Aug 2023Release notes
Open source →Compatibility
- MSRV bumped to 1.70.0
Performance
- Improved build-times by dropping the
is-terminaldependency
Features
- Wildcard support for structured data
-
0.4.1113 Apr 2023 -
0.4.1016 Mar 2023 -
0.4.915 Mar 2023Release notes
Open source →Compatibility
- Update MSRV to 1.64.0
- Deprecated
color-autofeature, its now automatic
-
0.4.801 Mar 2023 -
0.4.720 Feb 2023 -
0.4.619 Feb 2023Release notes
Open source →Features
- Added
examplesfeature to expose example-compilation functions in thecmdmodule
- Added
-
0.4.515 Feb 2023