Function predicates::predicate::eq [] [src]

pub fn eq<T>(constant: T) -> EqPredicate<T> where
    T: PartialEq

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

Examples

use predicates::predicate::*;

let predicate_fn = eq(5);
assert_eq!(true, predicate_fn.eval(&5));
assert_eq!(false, predicate_fn.eval(&10));