From 2d41bc3e6c1adb8abce5c796cfd24f77fee6f420 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 25 Aug 2018 14:26:34 +0300 Subject: rename --- crates/assert_eq_text/Cargo.toml | 8 -------- crates/assert_eq_text/src/lib.rs | 36 ------------------------------------ 2 files changed, 44 deletions(-) delete mode 100644 crates/assert_eq_text/Cargo.toml delete mode 100644 crates/assert_eq_text/src/lib.rs (limited to 'crates/assert_eq_text') diff --git a/crates/assert_eq_text/Cargo.toml b/crates/assert_eq_text/Cargo.toml deleted file mode 100644 index e122bbbeb..000000000 --- a/crates/assert_eq_text/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "assert_eq_text" -version = "0.1.0" -authors = ["Aleksey Kladov "] - -[dependencies] -difference = "2.0.0" -itertools = "0.7.8" diff --git a/crates/assert_eq_text/src/lib.rs b/crates/assert_eq_text/src/lib.rs deleted file mode 100644 index 26b9bfb38..000000000 --- a/crates/assert_eq_text/src/lib.rs +++ /dev/null @@ -1,36 +0,0 @@ -extern crate difference; -extern crate itertools; - -use std::fmt; -use itertools::Itertools; - -pub use self::difference::Changeset as __Changeset; - -#[macro_export] -macro_rules! assert_eq_text { - ($expected:expr, $actual:expr) => {{ - let expected = $expected; - let actual = $actual; - if expected != actual { - let changeset = $crate::__Changeset::new(actual, expected, "\n"); - println!("Expected:\n{}\n\nActual:\n{}\nDiff:{}\n", expected, actual, changeset); - panic!("text differs"); - } - }}; - ($expected:expr, $actual:expr, $($tt:tt)*) => {{ - let expected = $expected; - let actual = $actual; - if expected != actual { - let changeset = $crate::__Changeset::new(actual, expected, "\n"); - println!("Expected:\n{}\n\nActual:\n{}\n\nDiff:\n{}\n", expected, actual, changeset); - println!($($tt)*); - panic!("text differs"); - } - }}; -} - -pub fn assert_eq_dbg(expected: &str, actual: &impl fmt::Debug) { - let actual = format!("{:?}", actual); - let expected = expected.lines().map(|l| l.trim()).join(" "); - assert_eq!(expected, actual); -} -- cgit v1.2.3