Macro assertables::assert_not_ends_with

source ·
macro_rules! assert_not_ends_with {
    ($a:expr, $b:expr $(,)?) => { ... };
    ($a:expr, $b:expr, $($message:tt)+) => { ... };
}
Expand description

Assert an expression (such as a string) does not end with an expression (such as a string).

  • If true, return ().

  • Otherwise, call panic! with a message and the values of the expressions with their debug representations.

§Examples

let a = "alfa";
let b = "al";
assert_not_ends_with!(a, b);

let a = "alfa";
let b = "fa";
assert_not_ends_with!(a, b);
// assertion failed: `assert_not_ends_with!(a, b)`
//  a label: `a`,
//  a debug: `\"alfa\"`,
//  b label: `b`,
//  b debug: `\"fa\"`

§Module macros