Function predicates::str::diff
source · pub fn diff<S>(orig: S) -> DifferencePredicate
Expand description
Creates a new Predicate
that diffs two strings.
§Examples
use predicates::prelude::*;
let predicate_fn = predicate::str::diff("Hello World");
assert_eq!(true, predicate_fn.eval("Hello World"));
assert!(predicate_fn.find_case(false, "Hello World").is_none());
assert_eq!(false, predicate_fn.eval("Goodbye World"));
assert!(predicate_fn.find_case(false, "Goodbye World").is_some());