Skip to content

Commit 7acf2b9

Browse files
committed
add docstrings to matcher-combinators.test declarations
1 parent 3d88fc2 commit 7acf2b9

4 files changed

Lines changed: 21 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. This
33
change log follows the conventions of
44
[keepachangelog.com](http://keepachangelog.com/).
55

6+
## 3.10.1 / 2026-04-13
7+
Add docstrings to matcher-combinators.test declarations, used with clojure.test
8+
69
## 3.10.0 / 2026-01-27
710
- Don't error on mismatches when `actual` value is a Datomic EntityMap.
811
- include reporting functions in standalone match result

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This library addresses this issue by providing composable matcher combinators th
4141
Require the `matcher-combinators.test` namespace, which will extend `clojure.test`'s `is` macro to accept the `match?` and `thrown-match?` directives.
4242

4343
- `match?`: The first argument should be the matcher-combinator representing the expected value, and the second argument should be the expression being checked.
44-
- `thrown-match?`: The first argument should be a throwable subclass, the second a matcher-combinator, and the third the expression being checked.
44+
- `thrown-match?`: The first argument should be a throwable subclass, the second a matcher-combinator to be applied to the ex-data of the exception thrown, and the third the expression being checked. There is also a 2-arity version that takes just the matcher-combinator and expression.
4545

4646
For example:
4747

src/cljc/matcher_combinators/test.cljc

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,26 @@
1919
#?(:cljs [matcher-combinators.cljs-test]
2020
:clj [matcher-combinators.clj-test])))
2121

22-
(declare ^{:arglists '([matcher actual])}
22+
(declare ^{:arglists '([matcher actual])
23+
:doc "Asserts that the `actual` matches the `expected`, where the `expected` can be a value, a predicate function, or a matcher-combinator.
24+
25+
(is (match? [0 1 2] (range 3)))
26+
(is (match? (complement empty?) (range 3)))
27+
(is (match? (matcher-combinators.matchers/in-any-order [zero? odd? even?]) (range 3)))"}
2328
match?)
24-
(declare ^{:arglists '([type->matcher matcher actual])}
29+
(declare ^{:arglists '([type->matcher matcher actual])
30+
:doc "DEPRECATED: Use (match? (matcher-combinators.matchers/match-with <type->matcher> <expected>) <actual>) instead."}
2531
match-with?)
2632
(declare ^{:arglists '([matcher actual]
27-
[exception-class matcher actual])}
33+
[exception-class matcher actual])
34+
:doc "Asserts that evaluating expr throws an exception where the excpetion's ex-data satisfies the provided matcher.
35+
36+
2-arity: (is (thrown-with-match? matcher expr))
37+
3-arity: (is (thrown-with-match? exception-class matcher expr))"}
2838
thrown-match?)
29-
(declare ^{:arglists '([delta matcher actual])}
30-
match-roughly?)
39+
(declare ^{:arglists '([delta matcher actual])
40+
:doc "DEPRECATED: Instead use (match? (matcher-combinators.matchers/match-with [number? (matcher-combinators.matchers/within-delta 0.01M)] <expected>) <actual>)"}
41+
match-roughly?)
3142

3243
#?(:clj
3344
(def build-match-assert

version.edn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{:major 3
22
:minor 10
3-
:release 0
3+
:release 1
44
#_#_ :qualifier :alpha}

0 commit comments

Comments
 (0)