Macro assertables::assert_bag_ne [−][src]
macro_rules! assert_bag_ne { ($left:expr, $right:expr $(,)?) => { ... }; ($left:expr, $right:expr, $($arg:tt)+) => { ... }; }
Expand description
Assert two bags are not equal.
-
When true, return
(). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
Examples
assert_bag_ne!([1, 1], [1, 1, 1]); //-> ()
// assert_bag_ne!([1, 1], [1, 1]); //-> panic!("assertion failed: `assert_bag_ne(left, right)`\n left: `[1, 1]`\n right: `[1, 1]`")
This macro has a second form where a custom message can be provided.
This implementation uses [HashMap] to count items.