Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 4, 2024
1 parent 8656a33 commit 7ceaef6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 70 deletions.
19 changes: 0 additions & 19 deletions ChangeLog.md
Expand Up @@ -37,15 +37,13 @@ Object:

* Fixed compatibility with the latest `rove`.
Bug was caused by [this commit][e59b].

* Also, now `hamcrest/rove` is covered by tests.

<a id="x-28HAMCREST-DOCS-2FCHANGELOG-3A-3A-7C0-2E4-2E2-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

## 0.4.2 (2018-06-03)

* Fixed hamcrest/prove compilation under `SBCL`.

* Travis config now contains only `SBCL` and `CCL`.

<a id="x-28HAMCREST-DOCS-2FCHANGELOG-3A-3A-7C0-2E4-2E1-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>
Expand All @@ -66,15 +64,10 @@ now uses `package-inferred` asdf class.
## 0.3.4 (2018-01-29)

* These symbols were exported to fix Rove integration:

* `assertion-error`

* `assertion-error-reason`

* `assertion-context`

* `assertion-error-reason-with-context`

* `contains` matcher now saves it's form to make
error report better under the Rove.

Expand Down Expand Up @@ -102,7 +95,6 @@ now uses `package-inferred` asdf class.

* System was refactored to use `:package-inferred-system` `ASDF` option.
Now all packages use `/` instead of dots.

* Now cl-hamcrest supports `Rove` test framework, but you need a
patched version from https://github.com/40ants/rove, because it wasn't
accepted to the upstream yet.
Expand All @@ -120,9 +112,7 @@ reports "Result is empty" in case if checked sequence has zero length.
## 0.2.0 (2017-04-13)

* Added `length` matcher.

* Added nice documentation.

* Removed special hack-around to work with Prove (now
latest Prove's version from repository is required).

Expand All @@ -131,23 +121,14 @@ reports "Result is empty" in case if checked sequence has zero length.
## 0.1.0 (2017-04-02)

* First version. Contains following matchers:

* `has-plist-entries`;

* `hasnt-plist-keys`;

* `has-alist-entries`;

* `has-hash-entries`;

* `has-properties`;

* `has-slots`;

* `contains` and `contains-in-any-order`;

* `any`;

* `has-all`.


Expand Down
94 changes: 43 additions & 51 deletions README.md
Expand Up @@ -7,14 +7,11 @@
## HAMCREST ASDF System Details

* Description: A set of helpers to make your unittests more readable by using Hamcrest assertions.

* Licence: New `BSD` License

* Author: Alexander Artemenko

* Bug tracker: [https://github.com/40ants/cl-hamcrest/issues][eafb]

* Source control: [GIT][46fe]
* Depends on: [alexandria][8236], [cl-ppcre][49b9], [iterate][7d7b], [split-sequence][3dcd]

[![](https://github-actions.40ants.com/40ants/cl-hamcrest/matrix.svg)][3156]

Expand Down Expand Up @@ -164,7 +161,7 @@ alists and property lists.

<a id="x-28HAMCREST-2FMATCHERS-3AHAS-PLIST-ENTRIES-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

#### [macro](838d) `hamcrest/matchers:has-plist-entries` &rest entries
#### [macro](8a74) `hamcrest/matchers:has-plist-entries` &rest entries

Matches plist entries:

Expand All @@ -179,7 +176,7 @@ This way you can test any number of plist's entries.

<a id="x-28HAMCREST-2FMATCHERS-3AHASNT-PLIST-KEYS-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

#### [macro](4d8c) `hamcrest/matchers:hasnt-plist-keys` &rest keys
#### [macro](d946) `hamcrest/matchers:hasnt-plist-keys` &rest keys

Checks if given keys are missing from an object:

Expand All @@ -199,7 +196,7 @@ TEST> (let ((obj '(:foo "bar")))
```
<a id="x-28HAMCREST-2FMATCHERS-3AHAS-ALIST-ENTRIES-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

#### [macro](2b03) `hamcrest/matchers:has-alist-entries` &rest entries
#### [macro](821f) `hamcrest/matchers:has-alist-entries` &rest entries

Matches alist entries:

Expand All @@ -226,7 +223,7 @@ TEST> (let ((obj '((:the-key . "value"))))
```
<a id="x-28HAMCREST-2FMATCHERS-3AHAS-HASH-ENTRIES-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

#### [macro](cf50) `hamcrest/matchers:has-hash-entries` &rest entries
#### [macro](d876) `hamcrest/matchers:has-hash-entries` &rest entries

Matches hash entries:

Expand Down Expand Up @@ -255,7 +252,7 @@ TEST> (let ((obj (make-hash-table)))
```
<a id="x-28HAMCREST-2FMATCHERS-3AHAS-PROPERTIES-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

#### [macro](477a) `hamcrest/matchers:has-properties` &rest entries
#### [macro](8291) `hamcrest/matchers:has-properties` &rest entries

Matches object properties:

Expand All @@ -278,7 +275,7 @@ TEST> (assert-that 'the-object
```
<a id="x-28HAMCREST-2FMATCHERS-3AHAS-SLOTS-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

#### [macro](2fa2) `hamcrest/matchers:has-slots` &rest entries
#### [macro](59b7) `hamcrest/matchers:has-slots` &rest entries

Matches object slots:

Expand All @@ -305,7 +302,7 @@ TEST> (assert-that task
```
<a id="x-28HAMCREST-2FMATCHERS-3AHAS-TYPE-20FUNCTION-29"></a>

#### [function](fe1c) `hamcrest/matchers:has-type` expected-type
#### [function](409d) `hamcrest/matchers:has-type` expected-type

Checks if a list have specivied length.

Expand All @@ -322,7 +319,7 @@ TEST> (funcall (has-type 'cons) 100500)

<a id="x-28HAMCREST-2FMATCHERS-3AHAS-LENGTH-20FUNCTION-29"></a>

#### [function](add5) `hamcrest/matchers:has-length` expected-length
#### [function](b8c8) `hamcrest/matchers:has-length` expected-length

Checks if a list have specivied length.

Expand All @@ -338,7 +335,7 @@ TEST> (assert-that '(a b c d) (has-length 100500))
```
<a id="x-28HAMCREST-2FMATCHERS-3ACONTAINS-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

#### [macro](0b1d) `hamcrest/matchers:contains` &rest entries
#### [macro](29a3) `hamcrest/matchers:contains` &rest entries

Checks if each item from a list matches to given matchers.

Expand Down Expand Up @@ -373,7 +370,7 @@ TEST> (assert-that '(:foo
```
<a id="x-28HAMCREST-2FMATCHERS-3ACONTAINS-IN-ANY-ORDER-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

#### [macro](a146) `hamcrest/matchers:contains-in-any-order` &rest entries
#### [macro](206e) `hamcrest/matchers:contains-in-any-order` &rest entries

Same as `contains`, but items in the sequence can be in any order:

Expand All @@ -394,7 +391,7 @@ TEST> (assert-that '(:foo

<a id="x-28HAMCREST-2FMATCHERS-3AANY-20FUNCTION-29"></a>

#### [function](aead) `hamcrest/matchers:any`
#### [function](9cac) `hamcrest/matchers:any`

Assertion is passed regardles of value of the object:

Expand All @@ -413,7 +410,7 @@ TEST> (assert-that '(1 2 3) (any))
```
<a id="x-28HAMCREST-2FMATCHERS-3AHAS-ALL-20FUNCTION-29"></a>

#### [function](ba2f) `hamcrest/matchers:has-all` &rest matchers
#### [function](dac9) `hamcrest/matchers:has-all` &rest matchers

Makes a matcher which groups another matchers with `AND` logic.

Expand All @@ -440,13 +437,13 @@ TEST> (assert-that '(:foo "bar" :blah "minor")

<a id="x-28HAMCREST-2FMATCHERS-3A-5F-20FUNCTION-29"></a>

#### [function](7f3f) `hamcrest/matchers:_`
#### [function](355e) `hamcrest/matchers:_`

Symbol _ should be used as is not as a function.

<a id="x-28HAMCREST-2FMATCHERS-3AMATCHER-DESCRIPTION-20FUNCTION-29"></a>

#### [function](ff0e) `hamcrest/matchers:matcher-description` fn
#### [function](75f3) `hamcrest/matchers:matcher-description` fn

Returns description of a given matcher function.

Expand All @@ -472,7 +469,7 @@ TEST> (matcher-description (has-plist-entries
```
<a id="x-28HAMCREST-2FMATCHERS-3AMATCHER-FORM-20FUNCTION-29"></a>

#### [function](1541) `hamcrest/matchers:matcher-form` fn
#### [function](5220) `hamcrest/matchers:matcher-form` fn

Returns description of a given matcher function.

Expand All @@ -498,19 +495,19 @@ TEST> (matcher-description (has-plist-entries
```
<a id="x-28HAMCREST-2FMATCHERS-3AASSERTION-ERROR-20CONDITION-29"></a>

#### [condition](ebcb) `hamcrest/matchers:assertion-error` (error)
#### [condition](c382) `hamcrest/matchers:assertion-error` (error)

<a id="x-28HAMCREST-2FMATCHERS-3AASSERTION-ERROR-REASON-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20HAMCREST-2FMATCHERS-3AASSERTION-ERROR-29-29"></a>

#### [reader](ebcb) `hamcrest/matchers:assertion-error-reason` (assertion-error) (:reason)
#### [reader](c382) `hamcrest/matchers:assertion-error-reason` (assertion-error) (:reason)

<a id="x-28HAMCREST-2FMATCHERS-3AASSERTION-CONTEXT-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20HAMCREST-2FMATCHERS-3AASSERTION-ERROR-29-29"></a>

#### [reader](ebcb) `hamcrest/matchers:assertion-context` (assertion-error) (= '(copy-list \*context\*))
#### [reader](c382) `hamcrest/matchers:assertion-context` (assertion-error) (= '(copy-list \*context\*))

<a id="x-28HAMCREST-2FMATCHERS-3AASSERTION-ERROR-REASON-WITH-CONTEXT-20FUNCTION-29"></a>

#### [function](e7c5) `hamcrest/matchers:assertion-error-reason-with-context` condition &key (indent-spaces 2)
#### [function](819e) `hamcrest/matchers:assertion-error-reason-with-context` condition &key (indent-spaces 2)

Returns a multiline string where error reason is nested into the context
like that:
Expand Down Expand Up @@ -561,7 +558,7 @@ All available matchers are described in the hamcrest-docs/matchers:@matchers sec

<a id="x-28HAMCREST-2FPROVE-3AASSERT-THAT-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

### [macro](8dc9) `hamcrest/prove:assert-that` value &rest matchers
### [macro](188e) `hamcrest/prove:assert-that` value &rest matchers

Main macro to test values agains matchers.

Expand All @@ -570,29 +567,20 @@ Main macro to test values agains matchers.
## Roadmap

* Logical matchers:

* `any-of` – Matches if any of the given matchers evaluate to True.

* `is-not` – Inverts the given matcher to its logical negation (think if
we need it, and how to show the results, here are results
how it works [in PyHamcrest][931c]
– it just sees that matcher returned True and raises Assertion error with full object's content and
matcher's description with prepended 'not' particle).

* Object matchers:

* Add `hasnt-some-keys` matchers, corresponding to
`has-some-entries`.

* Make `has-alist-entries` work with keys other than keyword
right now it uses `eql` to compare keys.

* Sequence matchers:

* `is-in` – Matches if evaluated object is present in a given sequence.

* Other features:

* Use uniq CommonLisp feature to restart signaled conditions to collect
all problems with data when there are few problems with keys.

Expand All @@ -602,27 +590,31 @@ all problems with data when there are few problems with keys.
[931c]: https://gist.github.com/svetlyak40wt/fbe480384e9e3f75b10523aa0b4fb6ce
[46fe]: https://github.com/40ants/cl-hamcrest
[3156]: https://github.com/40ants/cl-hamcrest/actions
[ebcb]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L123
[e7c5]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L141
[7f3f]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L224
[838d]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L339
[2b03]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L367
[cf50]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L408
[ff0e]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L44
[477a]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L450
[2fa2]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L487
[4d8c]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L533
[aead]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L575
[ba2f]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L602
[add5]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L645
[0b1d]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L681
[1541]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L76
[a146]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L764
[fe1c]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/matchers.lisp#L828
[8dc9]: https://github.com/40ants/cl-hamcrest/blob/70be315e6223b2693683f32911fb24b457d83736/src/prove.lisp#L43
[c382]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L123
[819e]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L141
[355e]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L224
[8a74]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L339
[821f]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L367
[d876]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L408
[75f3]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L44
[8291]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L450
[59b7]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L487
[d946]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L533
[9cac]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L575
[dac9]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L602
[b8c8]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L645
[29a3]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L681
[5220]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L76
[206e]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L764
[409d]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/matchers.lisp#L828
[188e]: https://github.com/40ants/cl-hamcrest/blob/8656a33a3ef8b5987a723c272c465c3c86357006/src/prove.lisp#L43
[eafb]: https://github.com/40ants/cl-hamcrest/issues
[653f]: https://github.com/fukamachi/prove
[8236]: https://quickdocs.org/alexandria
[49b9]: https://quickdocs.org/cl-ppcre
[7d7b]: https://quickdocs.org/iterate
[d992]: https://quickdocs.org/optima
[3dcd]: https://quickdocs.org/split-sequence

* * *
###### [generated by [40ANTS-DOC](https://40ants.com/doc/)]

0 comments on commit 7ceaef6

Please sign in to comment.