Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Use pretty _ assertions For Colorful, Easier To Read Test Error Output

rust
//! ```cargo
//! [dependencies]
//! pretty_assertions = "1.4.0"
//! ```

use pretty_assertions::assert_eq;

#[derive(Debug, PartialEq)]
struct Foo {
    lorem: &'static str,
    ipsum: u32,
    dolor: Result<String, String>,
}

fn main() {
  let x = Some(Foo { lorem: "Hello World!", ipsum: 42, dolor: Ok("hey".to_string())});
  let y = Some(Foo { lorem: "Hello Wrold!", ipsum: 42, dolor: Ok("hey ho!".to_string())});
  assert_eq!(x, y);
}