Macro assertables::assume_bag_ne[][src]

macro_rules! assume_bag_ne {
    ($left:expr, $right:expr $(,)?) => { ... };
    ($left:expr, $right:expr, $($arg:tt)+) => { ... };
}

Assume two bags are not equal.

  • When true, return Ok(true).

  • Otherwise, return Err with a message and the values of the expressions with their debug representations.

Example

let a = [1, 1];
let b = [1, 1, 1];
let x = assume_bag_ne!(&a, &b);
//-> Ok(true)
let a = [1, 1];
let b = [1, 1, 1];
let x = assume_bag_ne!(&a, &b);
//-> Err("assume_bag_ne left:[1, 1] right:[1, 1, 1]")

This macro has a second form where a custom message can be provided.

This implementation uses [HashMap] to count items.