assert_err_eq

Macro assert_err_eq 

Source
macro_rules! assert_err_eq {
    ($result:expr, $expected:expr) => { ... };
}
Expand description

Asserts that a result is an error and contains a specific tag or message.

This macro iterates through the error’s core message and all attached contexts (both simple and grouped) to find a match with the expected string.

§Arguments

  • $result - A Result or ComposableResult to check.
  • $expected - The string to search for in tags, messages, or the core error.

§Panics

Panics if the result is Ok or if the error does not contain the expected string.