| Crates.io | str_assert |
| lib.rs | str_assert |
| version | 0.2.0 |
| created_at | 2024-05-26 09:08:21.966735+00 |
| updated_at | 2024-05-26 09:10:42.654399+00 |
| description | Thin wrapper around stdlib assert_eq macros using dissimilar as the comparison. (Only for strings) |
| homepage | |
| repository | https://github.com/dustinknopoff/str_assert |
| max_upload_size | |
| id | 1252447 |
| size | 18,939 |
Ideal for figuring out what part of a large string is causing tests to fail.
Thin wrapper around the stdlib assert_eq and assert_ne but using dissimilar for comparison
For example
#[test]
fn has_diff() {
str_assert_eq!("Lorem ipsum doleret", "Lorem ipsum dolert", "Error");
}
Will panic with the message
assertion failed: `(left == right)`
diff: [
Equal("Lorem ipsum doler"),
Delete("e"),
Equal("t"),
]: Error