assertables

Macro 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).

Pseudocode:
¬ a.ends_with(b)

  • 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)`
// https://docs.rs/assertables/8.9.0/assertables/macro.assert_not_ends_with.html
//  a label: `a`,
//  a debug: `\"alfa\"`,
//  b label: `b`,
//  b debug: `\"fa\"`

§Module macros