mitsuhiko / similar-asserts

Provides assert_eq! like macros with colorized diff output

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Provides assert_eq! like macros with colorized diff output

License:Apache License 2.0


Languages

Language:Rust 98.3%Language:Makefile 1.7%