You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
;; The container checkers work on strings:
user> (fact"the quick brown fox" => (has-suffix"fox"))
true;; I've tried to make diagnostics useful:
user> (fact"where is the animal?" => (contains"hen"))
FAIL at (NO_SOURCE_FILE:1)
Actual result did not agree with the checking function.
Actual result: "where is the animal?"
Checking function: (contains"hen")
The checker said this about the reason:
Best match found: [\h \e]
false
user> (fact"where is the animal?" => (contains"hen":gaps-ok))
true
user> (fact"where is the animal?" => (contains"lama":in-any-order:gaps-ok))
true;; "Lama" is too a valid alternate spelling of "llama".;; The same checkers work on collections:
user> (fact [4 'h "regex"2] => (contains [2#"re"4] :in-any-order:gaps-ok))
true;; You can use checkers within checkers:
user> (fact {:a1:b3:c5} => (just {:a odd? :b odd? :c odd?}))
true;; One I use a lot is for maps with array values:
user> (fact {:notes ["Behold! The value is 5"] :actual3}
=> (contains {:notes (just [#"value is 5"])}))
true