Skip to content

Commit 09d013c

Browse files
authored
Remove mentions of kotest-assertions-collections from the docs (#4383)
Closes #4353 This module no longer exists, collection assertions are a part of core. The table from `collections.md` was copied into `core.md` verbatim. `kotest-assertions-collections` was removed from the list of external modules, and `collections.md` was deleted.
1 parent b65cd33 commit 09d013c

File tree

4 files changed

+45
-54
lines changed

4 files changed

+45
-54
lines changed

documentation/docs/assertions/collections.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

documentation/docs/assertions/core.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,51 @@ Matchers provided by the `kotest-assertions-core` module.
4040
| `comp.shouldBeGreaterThan(other)` | Uses `compareTo` to verify that `comp` is greater than `other` |
4141
| `comp.shouldBeGreaterThanOrEqualTo(other)` | Uses `compareTo` to verify that `comp` is greater than or equal to `other` |
4242

43+
44+
Collections: also see [inspectors](inspectors.md) which are useful ways to test multiple elements in a collection.
45+
46+
| Collections | |
47+
|-------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
48+
| `collection.shouldBeEmpty()` | Asserts that the collections has zero elements. |
49+
| `collection.shouldBeUnique()` | Asserts that all the elements of the collection are distinct using the natural equals of the elements. |
50+
| `collection.shouldBeUnique(comparator)` | Asserts that all the elements of the collection are distinct by comparing elements using the given `comparator`. |
51+
| `collection.shouldContain(element)` | Asserts that the collection contains the given element. |
52+
| `collection.shouldContainAll(e1, e2, ..., en)` | Asserts that the collection contains all the elements listed, where order is not important. Ie, element 2 can be in the collection before element 1. |
53+
| `collection.shouldContainDuplicates()` | Asserts that the collection contains at least one duplicate element. |
54+
| `collection.shouldContainExactly()` | Assert that a collection contains exactly the given values and nothing else, in order. |
55+
| `collection.shouldContainExactlyInAnyOrder()` | Assert that a collection contains exactly the given values and nothing else, in _any_ order. |
56+
| `collection.shouldContainAllInAnyOrder()` | Assert that a collection contains all the given values, in _any_ order. |
57+
| `collection.shouldContainNoNulls()` | Asserts that the collection contains no null elements, or is empty. |
58+
| `collection.shouldContainNull()` | Asserts that the collection contains at least one null element. |
59+
| `collection.shouldContainOnlyNulls()` | Asserts that the collection contains only null elements, or is empty. |
60+
| `collection.shouldContainAllIgnoringFields()` | Asserts that the collection contains all the elements listed ignoring one or more fields. |
61+
| `collection.shouldHaveSingleElement(element)` | Asserts that the collection only contains a single element and that that element is the given one. |
62+
| `collection.shouldHaveSingleElement { block }` | Asserts that the collection contains a single element by a given predicate. |
63+
| `collection.shouldHaveSize(length)` | Asserts that the collection is exactly the given length. |
64+
| `collection.shouldBeSingleton()` | Asserts that the collection contains only one element. |
65+
| `collection.shouldBeSingleton { block }` | Asserts that the collection only one element, and then, runs the block with this element. |
66+
| `collection.shouldHaveLowerBound(element)` | Asserts that the given element is smaller or equal to every element of the collection. Works only for elements that implement Comparable. |
67+
| `collection.shouldHaveUpperBound(element)` | Asserts that the given element is larger or equal to every element of the collection. Works only for elements that implement Comparable. |
68+
| `collection.shouldBeSmallerThan(col)` | Asserts that the collection is smaller than the other collection. |
69+
| `collection.shouldBeLargerThan(col)` | Asserts that the collection is larger than the other collection. |
70+
| `collection.shouldBeSameSizeAs(col)` | Asserts that the collection has the same size as the other collection. |
71+
| `collection.shouldHaveAtLeastSize(n)` | Asserts that the collection has at least size n. |
72+
| `collection.shouldHaveAtMostSize(n)` | Asserts that the collection has at most size n. |
73+
| `list.shouldBeSorted()` | Asserts that the list is sorted. |
74+
| `list.shouldBeSortedBy { transform }` | Asserts that the list is sorted by the value after applying the transform. |
75+
| `list.shouldContainInOrder(other)` | Asserts that this list contains the given list in order. Other elements may appear either side of the given list. |
76+
| `list.shouldExistInOrder({ element }, ...)` | Asserts that this list contains elements matching the predicates in order. Other elements may appear around or between the elements matching the predicates. |
77+
| `list.shouldHaveElementAt(index, element)` | Asserts that this list contains the given element at the given position. |
78+
| `list.shouldStartWith(lst)` | Asserts that this list starts with the elements of the given list, in order. |
79+
| `list.shouldEndWith(lst)` | Asserts that this list ends with the elements of the given list, in order. |
80+
| `iterable.shouldMatchEach(assertions)` | Iterates over this list and the assertions and asserts that each element of this list passes the associated assertion. Fails if size of the collections mismatch. |
81+
| `iterable.shouldMatchInOrder(assertions)` | Asserts that there is a subsequence of this iterator that matches the assertions in order, with no gaps allowed. |
82+
| `iterable.shouldMatchInOrderSubset(assertions)` | Asserts that there is a subsequence (possibly with gaps) that matches the assertions in order. |
83+
| `value.shouldBeOneOf(collection)` | Asserts that a specific instance is contained in a collection. |
84+
| `collection.shouldContainAnyOf(collection)` | Asserts that the collection has at least one of the elements in `collection` |
85+
| `value.shouldBeIn(collection)` | Asserts that an object is contained in collection, checking by value and not by reference. |
86+
87+
4388
| Iterator ||
4489
|-----------------------------| ---- |
4590
| `iterator.shouldBeEmpty()` | Asserts that the iterator does not have a next value. |

documentation/docs/assertions/matchers.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Kotest framework.
1111
| Module | Description | Type |
1212
|-------------------------------------------------------|--------------------------------------------------------------|---------------|
1313
| [kotest-assertions-core](core.md) | Provides matchers for standard libary types. | Multiplatform |
14-
| [kotest-assertions-collections](collections.md) | Provides matchers for Collection, Iterable, and Array types. | Multiplatform |
1514
| [kotest-assertions-json](json/overview.md) | Provides matchers for testing json objects. | JVM |
1615
| [kotest-assertions-kotlinx-time](kotlinx-datetime.md) | Provides matchers for Kotlin's date / time library. | Multiplatform |
1716
| [kotest-assertions-sql](sql.md) | Provides matchers for JDBC. | JVM |

documentation/sidebars.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ module.exports = {
7272
"collapsed": false,
7373
"items": [
7474
"assertions/core",
75-
"assertions/collections",
7675
{
7776
"type": "category",
7877
"label": "JSON",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy