home
NOTE: Under Construction - I'm in the middle of upgrading my site and lots of stuff is kinda broken. Please forgive the mess.

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

December 2023
Code
//! ```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);
}
═══ § ═══