See documentation in docs/approximately-equal.md.
See documentation in `docs/approximately-equal.md`.
Whether to enable Methodical method tracing for debug purposes.
Whether to enable Methodical method tracing for debug purposes.
(=?-diff expected actual)Multimethod to use to diff two things with =?. Despite not having earmuffs, this is dynamic so it can be rebound at
runtime.
=?-diff is defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:13).
It caches methods using a methodical.impl.cache.watching.WatchingCache.
It uses the method combination methodical.impl.combo.threaded.ThreadingMethodCombination
with the threading strategy :thread-last.
It uses the dispatcher methodical.impl.dispatcher.multi_default.MultiDefaultDispatcher
with hierarchy #'clojure.core/global-hierarchy
and prefs {}.
The default value is :default.
It uses the method table methodical.impl.method_table.standard.StandardMethodTable.
These primary methods are known:
[java.util.regex.Pattern java.util.regex.Pattern], defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:70)
[mb.hawk.assert_exprs.approximately_equal.Exactly :default], defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:138)
[java.util.regex.Pattern java.lang.String], defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:64)
[java.lang.Class java.lang.Object], defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:59)
:default, defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:54)
[mb.hawk.assert_exprs.approximately_equal.Same :default], defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:262)
[clojure.lang.AFunction nil], defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:80)
[clojure.lang.IPersistentMap clojure.lang.IPersistentMap], defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:108)
[clojure.lang.Sequential clojure.lang.Sequential], defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:85)
[mb.hawk.assert_exprs.approximately_equal.Schema :default], defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:165)
[clojure.lang.AFunction java.lang.Object], defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:75)
[mb.hawk.assert_exprs.approximately_equal.Malli :default], defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:190)
[mb.hawk.assert_exprs.approximately_equal.Approx java.lang.Number], defined in mb.hawk.assert-exprs.approximately-equal (mb/hawk/assert_exprs/approximately_equal.clj:226)
Multimethod to use to diff two things with `=?`. Despite not having earmuffs, this is dynamic so it can be rebound at
runtime.
=?-diff is defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:13).
It caches methods using a `methodical.impl.cache.watching.WatchingCache`.
It uses the method combination `methodical.impl.combo.threaded.ThreadingMethodCombination`
with the threading strategy `:thread-last`.
It uses the dispatcher `methodical.impl.dispatcher.multi_default.MultiDefaultDispatcher`
with hierarchy `#'clojure.core/global-hierarchy`
and prefs `{}`.
The default value is `:default`.
It uses the method table `methodical.impl.method_table.standard.StandardMethodTable`.
These primary methods are known:
* `[java.util.regex.Pattern java.util.regex.Pattern]`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:70)
* `[mb.hawk.assert_exprs.approximately_equal.Exactly :default]`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:138)
* `[java.util.regex.Pattern java.lang.String]`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:64)
* `[java.lang.Class java.lang.Object]`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:59)
* `:default`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:54)
* `[mb.hawk.assert_exprs.approximately_equal.Same :default]`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:262)
* `[clojure.lang.AFunction nil]`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:80)
* `[clojure.lang.IPersistentMap clojure.lang.IPersistentMap]`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:108)
* `[clojure.lang.Sequential clojure.lang.Sequential]`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:85)
* `[mb.hawk.assert_exprs.approximately_equal.Schema :default]`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:165)
* `[clojure.lang.AFunction java.lang.Object]`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:75)
* `[mb.hawk.assert_exprs.approximately_equal.Malli :default]`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:190)
* `[mb.hawk.assert_exprs.approximately_equal.Approx java.lang.Number]`, defined in [[mb.hawk.assert-exprs.approximately-equal]] (mb/hawk/assert_exprs/approximately_equal.clj:226) (=?-diff* expected actual)(=?-diff* diff-fn expected actual)Are expected and actual 'approximately' equal to one another?
Are `expected` and `actual` 'approximately' equal to one another?
(approx form)Used inside a =? expression. Compares whether two numbers are approximately equal.
Used inside a =? expression. Compares whether two numbers are approximately equal.
(exactly expected)Used inside a =? expression. Results have to be exactly equal as if by =. Use this to get around the normal way =? would compare things. This works inside collections as well.
Used inside a =? expression. Results have to be exactly equal as if by =. Use this to get around the normal way =? would compare things. This works inside collections as well.
(malli schema)Used inside a =? expression. Compares things to a malli schema.
Used inside a =? expression. Compares things to a malli schema.
(same k)Used inside a =? expression. Checks that all occurrences of the same [[k]] value are equal.
On the first occurrence of (same k), it saves the actual value under [[k]].
All other occurrences of (same k) are expected to be equal to that saved value.
(is (?= [(same :id) (same :id)}] [1 1])) ; => true
(is (?= [(same :id) (same :id)}] [1 2])) ; => false
Used inside a =? expression. Checks that all occurrences of the same [[k]] value are equal. On the first occurrence of `(same k)`, it saves the actual value under [[k]]. All other occurrences of `(same k)` are expected to be equal to that saved value. ``` (is (?= [(same :id) (same :id)}] [1 1])) ; => true (is (?= [(same :id) (same :id)}] [1 2])) ; => false ```
(schema schema)Used inside a =? expression. Compares things to a schema.core schema.
Used inside a =? expression. Compares things to a schema.core schema.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |