assert_iter_ge

Macro assert_iter_ge 

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

Assert an iterable is greater than or equal to another.

Pseudocode:
(collection1 into iter) ≥ (collection2 into iter)

  • If true, return ().

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

§Examples

use assertables::*;

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

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

This implementation uses ::std::iter::Iterator.

§Module macros