#assert #diff #color

dev similar-asserts

provides assert_eq! like macros with colorized diff output

2 stable releases

1.1.0 Feb 27, 2021
1.0.0 Feb 25, 2021

#226 in Rust patterns

Download history 85/week @ 2021-02-25 29/week @ 2021-03-04 18/week @ 2021-03-11 24/week @ 2021-03-18 62/week @ 2021-03-25 31/week @ 2021-04-01 49/week @ 2021-04-08 41/week @ 2021-04-15 37/week @ 2021-04-22 54/week @ 2021-04-29 135/week @ 2021-05-06 157/week @ 2021-05-13 90/week @ 2021-05-20 124/week @ 2021-05-27 169/week @ 2021-06-03 132/week @ 2021-06-10

207 downloads per month
Used in less than 10 crates

Apache-2.0

23KB
459 lines

similar-asserts

Build Status Crates.io License Documentation

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<_>>());
}

Related Projects

License and Links

Dependencies

~275–620KB
~12K SLoC