Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
673 changes: 313 additions & 360 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[workspace]
members = ["crates/*"]
resolver = "2"
resolver = "3"

[workspace.package]
repository = "https://github.com/assert-rs/snapbox/"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.66" # MSRV
edition = "2024"
rust-version = "1.85" # MSRV
include = [
"build.rs",
"src/**/*",
Expand Down
16 changes: 8 additions & 8 deletions crates/snapbox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,37 +69,37 @@ snapbox-macros = { path = "../snapbox-macros", version = "1.0.1" }

content_inspector = { version = "0.2.4", optional = true }

tempfile = { version = "3.26", optional = true }
tempfile = { version = "3.27", optional = true }
walkdir = { version = "2.5.0", optional = true }
dunce = { version = "1.0", optional = true }
filetime = { version = "0.2.27", optional = true }

os_pipe = { version = "1.2", optional = true }
wait-timeout = { version = "0.2.1", optional = true }
escargot = { version = "0.5.14", optional = true }
escargot = { version = "0.5.15", optional = true }

backtrace = { version = "0.3", optional = true }

similar = { version = "2.7.0", features = ["inline"], optional = true }

anstyle = "1.0.13"
anstyle = "1.0.14"
anstream = { version = "1.0.0", optional = true }

document-features = { version = "0.2.12", optional = true }

serde_json = { version = "1.0.145", optional = true}
anstyle-svg = { version = "1.0.0", optional = true }
serde_json = { version = "1.0.149", optional = true}
anstyle-svg = { version = "1.1.0", optional = true }
serde = { version = "1.0.228", optional = true }
regex = { version = "1.12.3", optional = true, default-features = false, features = ["std"] }

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.60.2", features = ["Win32_Foundation"], optional = true }
windows-sys = { version = "0.61.2", features = ["Win32_Foundation"], optional = true }

[target.'cfg(unix)'.dependencies]
libc = { version = "0.2.182", optional = true }
libc = { version = "0.2.183", optional = true }

[dev-dependencies]
automod = "1.0.15"
automod = "1.0.16"

[[example]]
name = "diff"
Expand Down
12 changes: 6 additions & 6 deletions crates/snapbox/src/assert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use anstream::stderr;
#[cfg(not(feature = "color"))]
use std::io::stderr;

use crate::filter::{Filter as _, FilterNewlines, FilterPaths, NormalizeToExpected};
use crate::IntoData;
use crate::filter::{Filter as _, FilterNewlines, FilterPaths, NormalizeToExpected};

pub use action::Action;
pub use action::DEFAULT_ACTION_ENV;
Expand Down Expand Up @@ -113,26 +113,26 @@ impl Assert {
mut actual: crate::Data,
mut expected: crate::Data,
) -> (crate::Data, crate::Data) {
if expected.filters.is_newlines_set() {
if expected.inner.filters.is_newlines_set() {
expected = FilterNewlines.filter(expected);
}

// On `expected` being an error, make a best guess
actual = actual.coerce_to(expected.against_format());
actual = actual.coerce_to(expected.intended_format());

if self.normalize_paths && expected.filters.is_paths_set() {
if self.normalize_paths && expected.inner.filters.is_paths_set() {
actual = FilterPaths.filter(actual);
}
if expected.filters.is_newlines_set() {
if expected.inner.filters.is_newlines_set() {
actual = FilterNewlines.filter(actual);
}

let mut normalize = NormalizeToExpected::new();
if expected.filters.is_redaction_set() {
if expected.inner.filters.is_redaction_set() {
normalize = normalize.redact_with(&self.substitutions);
}
if expected.filters.is_unordered_set() {
if expected.inner.filters.is_unordered_set() {
normalize = normalize.unordered();
}
actual = normalize.normalize(actual, &expected);
Expand Down
Loading
Loading