Module assert_len

Module assert_len 

Source
Expand description

Assert for comparing lengths.

These macros help with collection lengths, such as for strings, arrays, vectors, iterators, and anything that has a typical .len() method.

Compare a length with another length:

Compare a length with an expression:

§Example

use assertables::*;

let a = "x";
let b = "x";
assert_len_eq!(a, b);

Modules§

assert_len_eq
Assert a length is equal to another.
assert_len_eq_x
Assert a length is equal to an expression.
assert_len_ge
Assert a length is greater than or equal to another.
assert_len_ge_x
Assert a length is greater than or equal to an expression.
assert_len_gt
Assert a length is greater than another.
assert_len_gt_x
Assert a length is greater than an expression.
assert_len_le
Assert a length is less than or equal to another.
assert_len_le_x
Assert a length is less than or equal to an expression.
assert_len_lt
Assert a length is less than another.
assert_len_lt_x
Assert a length is less than an expression.
assert_len_ne
Assert a length is not equal to another.
assert_len_ne_x
Assert a length is not equal to an expression.