Crates.io | similar-asserts |
lib.rs | similar-asserts |
version | 1.6.0 |
source | src |
created_at | 2021-02-25 22:48:21.164161 |
updated_at | 2024-09-05 21:38:15.106942 |
description | provides assert_eq! like macros with colorized diff output |
homepage | |
repository | https://github.com/mitsuhiko/similar-asserts |
max_upload_size | |
id | 360732 |
size | 53,873 |
similar-asserts
is a crate that enhances the default assertion experience
by using similar for diffing. It supports
comparing either Debug
or Serialize
representations of values. On failed
assertions it renders out a colorized diff to the terminal.
fn main() {
let reference = vec![1, 2, 3, 4];
similar_asserts::assert_eq!(reference, (0..4).collect::<Vec<_>>());
}