macro_rules! assert_ends_with { ($a:expr, $b:expr $(,)?) => { ... }; ($a:expr, $b:expr, $($message:tt)+) => { ... }; }
Expand description
Assert an expression (such as a string) ends 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 = "fa";
assert_ends_with!(a, b);
let a = "alfa";
let b = "al";
assert_ends_with!(a, b);
// assertion failed: `assert_ends_with!(a, b)`
// https://docs.rs/assertables/8.9.0/assertables/macro.assert_ends_with.html
// a label: `a`,
// a debug: `\"alfa\"`,
// b label: `b`,
// b debug: `\"al\"`