diff --git a/crates/snapbox/src/assert.rs b/crates/snapbox/src/assert.rs index 2736ed8f..d9c583d9 100644 --- a/crates/snapbox/src/assert.rs +++ b/crates/snapbox/src/assert.rs @@ -62,6 +62,9 @@ impl Assert { #[track_caller] fn eq_inner(&self, expected: crate::Data, actual: crate::Data) { + if expected.source().is_none() && actual.source().is_some() { + panic!("received `(actual, expected)`, expected `(expected, actual)`"); + } match self.action { Action::Skip => { return; @@ -108,6 +111,9 @@ impl Assert { #[track_caller] fn matches_inner(&self, pattern: crate::Data, actual: crate::Data) { + if pattern.source().is_none() && actual.source().is_some() { + panic!("received `(actual, expected)`, expected `(expected, actual)`"); + } match self.action { Action::Skip => { return;