Macro assert_bag_ne

Source
macro_rules! assert_bag_ne {
    ($a_collection:expr, $b_collection:expr $(,)?) => { ... };
    ($a_collection:expr, $b_collection:expr, $($message:tt)+) => { ... };
}
Expand description

Assert a bag is not equal to another.

Pseudocode:
(a_collection ⇒ a_bag) ≠ (b_collection ⇒ b_bag)

  • If true, return (a, b).

  • Otherwise, call panic! with a message and the values of the expressions with their debug representations.

§Examples

use assertables::*;

let a = [1, 1];
let b = [1, 1, 1];
assert_bag_ne!(a, b);

// This will panic
let a = [1, 1];
let b = [1, 1];
assert_bag_ne!(a, b);
// assertion failed: `assert_bag_ne!(a_collection, b_collection)`
// https://docs.rs/assertables/…/assertables/macro.assert_bag_ne.html
//  a label: `a`,
//  a debug: `[1, 1]`,
//  b label: `b`,
//  b debug: `[1, 1]`,
//    a bag: `{1: 2}`,
//    b bag: `{1: 2}`

This implementation uses ::std::collections::BTreeMap to count items and sort them.

§Module macros