All notable changes to this project will be documented in this file. This change log follows the conventions of keepachangelog.com.
matcher-combinators.config
namespace to toggle use of ansi color
codes and the new output abbreviation mode.(matcher-combinators.config/enable-abbreviation!)
, an
experimental feature to print only the mismatched parts of a data-structure
while elliding the matched parts.m/regex
, m/pred
, etc)
inside match-with
.m/regex
, m/pred
, etc)
inside match-with
.match-with
misbehaves in ClojureScriptmatch?
in Clojurescriptmatcher-combinators.midje
namespace and functions in itseq-of
matcher, which takes a matcher, successfully matching when each element matches the provided matcher.any-of
matcher, which takes any number of matchers, successfully matching when at least one matches.all-of
matcher, which takes any number of matchers, successfully matching when all match.pred
matcher where the second argument is a description text.
enable!
and disable!
functions in matcher-combinators.ansi-color
via
matcher was addedvia
matcher, which transforms the actual
data-structure before applying the
expected
matcher.abs
for clojure-1.11.0(actual ...)
and (expected ...)
forms to improve readability.3.2.0
mismtach
matcher that is satisfied when the provided expected
doesn't match.undeclared Var matcher-combinators.matchers/Absent
warning introduced in 3.1.3
absent
matcher doesn't work with match-with
decimal?
within-delta
nested in match-with
where expected value is a listutils/within-delta?
to accept BigDecimal as delta
argumentmatch-with?
, match-equals?
, match-roughly?
assert expressionsmatch-with
, match-equals
, and match-roughly
midje checkers;; With this release, do this:
(match? (matchers/match-with [map? matchers/equals] <expected>) <actual>)
;; instead of this (deprecated, but still works)
(match-with? {clojure.lang.IPersistentMap matchers/equals} <expected> <actual>)
(match-equals? <expected> <actual>)
;; and this
(match? (matchers/within-delta <delta> <expected>) <actual>)
;; or this
(is (match? (matchers/match-with [number? (matchers/within-delta <delta>)]
<expected>)
<actual>))
;; instead of this
(match-roughly? <delta> <expected> <actual>)
We removed matcher-combinators.utils/match-roughly
in 3.0.0. If you were
using it, you should use matcher-combinators.matchers/within-delta
instead. We've documented matcher-combinators.utils
as "Internal use
only." for clarification.
false
in the context of sets #124Matcher
protocol to Symbol
in cljs #131matchers/matcher-for
#123java.util.Set
#125core/indicates-match?
and deprecate core/match?
core/match?
is mostly for internal use and occasionally used to build match?
fns in other librariesmatcher-combinators-2.0.0 includes a breaking change for custom implementations of the
matcher-combinators.core/Matcher
protocol:
match
to -match
(required)-matcher-for
(optional, but recommended)
this
e.g. `(-matcher-for [this] this)clojure.test
match-equals?
argumentsmatch
protocol, they now default to using equality matching.matcher-combinators.standalone/match
(test-framework independent)Add new matching context for clojure.test:
match-roughly?
: Matches all numerics as long as they are within a given delta of the expected.thrown-match?
: (thrown-match? {:foo 1} (bang!)
+'
with +
and -'
with -
in roughly matchingequals
matcher for array-seqequals
matcher for chunked-sequencesequals
matcher for URIsin-any-order
, embeds
, set-{embeds|equals}
)No such namespace: clojure.test
Add new matching contexts: For Midje:
match-with
: takes a class->matcher map and an expected matcher. The map defines what matcher will be used by default when a particular class instance is found.match-equals
: Allows for exact matching of datastructures by using the equals
matcher instead of embeds
for maps.match-roughly
: Matches all numerics as long as they are within a given delta of the expected.For clojure.test
:
match-with?
: same as the midje version abovematch-equals?
: same as the midje version above
As well as matcher-combinator.test/build-match-assert
to help build new matcher contexts:fail
, which is the standard in clojure.test
for reporting mismatches. Thanks to Arne Brasseur (@plexus) for implementationmatch?
and thrown-match?
[BREAKING] When a record is in the expected
position of the matcher, the
actual
value must be a record of the same type.
Previous behavior would match if the actual
was a map with the same keys,
or a record of a different type with the same keys
in-any-order
/ embeds
match?
to help avoid linters removing requirethrows-match
(midje) and thrown-match?
(clojure.test) exception handling matchersin-any-order
choose smallest mismatch when same number of matchers one level down fail.embeds
sequence matching where some matches weren't found:mismatch
directive for clojure.test
reportingprefix
matcher more informativeboolean?
which is only in clojure 1.9equals-map
, equals-seq
, and equals-value
to all be equals
and do dispatch based on typesublist
to prefix
subset
sequence matcher to be embeds
contains-map
to embeds
and make it do dispatch based on typeequals
and embeds
as well as set-equals
and set-embeds
which allow one to use sequences to match sets, skirting the
issue that a set matcher of form #{odd? odd?}
will reduce to #{odd?}
.in-any-order
to print diff for element ordering that leads to most direct matchesin-any-order
operating over a list with several identical matchers failednil
to be interpreted as equals-value
by parser:dev
profilematcher-combinators.matchers/equals-value
in parser.matcher-combinators.midje/matcher
as a macro; it isn't neededmatch
inside of midje
provided
formssubset
issue where order of elements effected behaviorCan you improve this documentation? These fine people already did:
Phillip Mates, David Chelimsky, Ivan Galban, Eric Dallo, Rafael de F. Ferreira, Flavio Schiavini Abe, Marcelo Piva, Edward Wible, EuAndreh & Lucas FerreiraEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close