assert_count_ge

Macro assert_count_ge 

Source
macro_rules! assert_count_ge {
    ($a:expr, $b:expr $(,)?) => { ... };
    ($a:expr, $b:expr, $($message:tt)+) => { ... };
}
Expand description

Assert a count is greater than or equal to another.

Pseudocode:
a.count() ≥ b.count()

  • If true, return (a.count(), b).

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

§Examples

use assertables::*;

let a = "xx".chars();
let b = "x".chars();
assert_count_ge!(a, b);

// This will panic
let a = "x".chars();
let b = "xx".chars();
assert_count_ge!(a, b);
// assertion failed: `assert_count_ge!(a, b)`
// https://docs.rs/assertables/…/assertables/macro.assert_count_ge.html
//  a label: `a`,
//  a debug: `Chars(['x'])`,
//  a.count(): `1`",
//  b label: `b`,
//  b debug: `Chars(['x', 'x'])`,
//  b.count(): `2`"

§Module macros