Skip to content

Commit

Permalink
test(assert): Show use case for 'is' vs 'against'
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jul 23, 2024
1 parent f8622b3 commit 1d01d1b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions crates/snapbox/tests/testsuite/assert.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use snapbox::assert_data_eq;
use snapbox::data::IntoData;
use snapbox::file;
use snapbox::str;

Expand Down Expand Up @@ -26,3 +27,22 @@ line1
fn test_expect_file() {
assert_data_eq!(include_str!("../../README.md"), file!["../../README.md"]);
}

#[test]
#[cfg(feature = "json")]
fn actual_expected_formats_differ() {
assert_data_eq!(
r#"{}
{"order": 1}
{"order": 2}
{"order": 3}
"#,
str![[r#"
{}
{"order":1}
{"order":2}
{"order":3}
"#]].is_jsonlines(),
);
}

0 comments on commit 1d01d1b

Please sign in to comment.