home ~ socials ~ projects ~ rss

Super helpful crate that shows color diffs in rust tests (including JSON outputs)

Usage

Cargo.toml
[dev-dependencies]
pretty_assertions = "1.4"
main.rs
fn main() {
  println!("Hello, Errors")
}


#[cfg(test)]
mod test {
    use pretty_assertions::{assert_eq, assert_ne};

    #[test]
    fn pretty_test() {
        assert_eq!(1, 2);
    }
}
end of line
Share link:
https://www.alanwsmith.com/en/2t/qr/zu/u8/?