Macro collapse::collapsed_eq
source · macro_rules! collapsed_eq { ($input:expr, $output:expr) => { ... }; ($input:expr, $output:expr, $($arg:tt)+) => { ... }; }
Expand description
Compare two strings, collapse consecutive whitespace, and assert their equality. Panics if two strings are not equivalent after collapsing whitespace.
#[macro_use]
use collapse::*;
collapsed_eq!("one space", "one space");
collapsed_eq!("two spaces", "two spaces");
collapsed_eq!("new\r\nlines", "new\nlines");
collapsed_eq!(" lead \t tail \r", "lead tail");