Liking cljdoc? Tell your friends :D

matcher-combinators.standalone

An API for using matcher-combinators outside the context of a test framework

An API for using matcher-combinators outside the context of a test framework
raw docstring

matchclj/s

(match matcher actual)

Returns a map indicating whether the actual value matches expected.

expected can be the expected value, a matcher, or a predicate fn of actual.

Return map includes the following keys:

  • :match/result - either :match or :mismatch
  • :mismatch/detail - the actual value with mismatch annotations.
  • ::pretty-print! - function that pretty prints the mismatch
  • ::report-clojure-test! - function that reports failure to clojure.test
Returns a map indicating whether the `actual` value matches `expected`.

`expected` can be the expected value, a matcher, or a predicate fn of actual.

Return map includes the following keys:

- :match/result          - either :match or :mismatch
- :mismatch/detail       - the actual value with mismatch annotations.
- ::pretty-print!        - function that pretty prints the mismatch
- ::report-clojure-test! - function that reports failure to clojure.test
sourceraw docstring

match?clj/s

(match? matcher)
(match? matcher actual)

Given a matcher and actual, returns true if (match matcher actual) results in a match. Else, returns false.

Given only a matcher, returns a function that will return true or false by the same logic.

Given a `matcher` and `actual`, returns `true` if
`(match matcher actual)` results in a match. Else, returns `false.`

Given only a `matcher`, returns a function that will
return true or false by the same logic.
sourceraw docstring

print!clj/s

(print! {pretty-print! :matcher-combinators.standalone/pretty-print!
         :as _match-result})

Given a match, pretty-print the mismatch data-structure

Given a `match`, pretty-print the mismatch data-structure
sourceraw docstring

report-clojure-test!clj/s

(report-clojure-test! {report!
                         :matcher-combinators.standalone/report-clojure-test!
                       :as _match-result})

Given a match, report the result to clojure.test

Given a `match`, report the result to clojure.test
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close