mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-03-23 04:34:39 +02:00
24 lines
615 B
Rust
24 lines
615 B
Rust
|
#[cfg(test)]
|
||
|
#[macro_export]
|
||
|
macro_rules! assert_eq_printed {
|
||
|
($expected:expr, $got:expr) => {
|
||
|
let expected = &*$expected;
|
||
|
let got = &*$got;
|
||
|
if expected != got {
|
||
|
panic!("
|
||
|
printed outputs differ!
|
||
|
|
||
|
expected:
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
{}
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
|
||
|
got:
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
{}
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
", expected, got);
|
||
|
}
|
||
|
}
|
||
|
}
|