Macro assert_set_ne

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

Assert a set is not equal to another.

Pseudocode:
(a_collection ⇒ a_set) ≠ (b_collection ⇒ b_set)

  • If true, return (a_set, b_set).

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

§Examples

use assertables::*;

let a = [1, 2];
let b = [3, 4];
assert_set_ne!(a, b);

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

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

§Module macros