mockall::predicate

Function le

pub fn le<T>(constant: T) -> OrdPredicate<T>
where T: PartialOrd + Debug,
Expand description

Creates a new predicate that will return true when the given variable is less than or equal to a pre-defined value.

ยงExamples

use predicates::prelude::*;

let predicate_fn = predicate::le(5);
assert_eq!(true, predicate_fn.eval(&4));
assert_eq!(true, predicate_fn.eval(&5));
assert_eq!(false, predicate_fn.eval(&6));