deno.land / x / deno@v1.28.2 / test_util / src / assertions.rs
12345678910111213141516171819202122232425262728293031323334353637383940#[macro_export]macro_rules! assert_ends_with { ($left:expr, $right:expr $(,)?) => { match (&$left, &$right) { (actual, expected) => { let actual = if expected.len() > actual.len() { actual } else { &actual[actual.len() - expected.len()..] }; pretty_assertions::assert_eq!( actual, *expected, "should end with expected." ); } } };}
#[macro_export]macro_rules! assert_contains { ($string:expr, $($test:expr),+ $(,)?) => { let string = &$string; // This might be a function call or something if !($(string.contains($test))||+) { panic!("{:?} does not contain any of {:?}", string, [$($test),+]); } }}
#[macro_export]macro_rules! assert_not_contains { ($string:expr, $($test:expr),+ $(,)?) => { let string = &$string; // This might be a function call or something if !($(!string.contains($test))||+) { panic!("{:?} contained {:?}", string, [$($test),+]); } }}
Version Info