Expand description
Assert macros for comparing bag collections.
These macros help with comparison of bag parameters, such as comparison of two arrays or two vectors, where the item order does not matter, and the item count does matter. These macros convert their inputs into HashMap iterators.
For eq & ne:
-
assert_bag_eq!(collection1, collection2)≈ bag a = bag b -
assert_bag_ne!(collection1, collection2)≈ bag a ≠ bag b
For subbag & superbag:
-
assert_bag_subbag(a, b)≈ bag a ⊆ bag b -
assert_bag_superbag!(collection1, collection2)≈ bag a ⊇ bag b
§Example
use assertables::*;
let a = [1, 1];
let b = [1, 1];
assert_bag_eq!(&a, &b);Modules§
- Assert a bag is equal to another.
- Assert a bag is not equal to another.
- Assert a bag is a subbag of another.
- Assert a bag is a superbag of another.