Skip to content

Commit

Permalink
Fix code samples in KDoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cketti authored and evant committed Mar 6, 2024
1 parent 5ff8a09 commit 59a43f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions assertk/src/commonMain/kotlin/assertk/assertions/iterable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ fun <E> Assert<Iterable<E>>.none(f: (Assert<E>) -> Unit) =
* The given lambda will be run for each item.
*
* ```
* assert(listOf(-1, 1, 2)).atLeast(2) { it.isPositive() }
* assertThat(listOf(-1, 1, 2)).atLeast(2) { it.isPositive() }
* ```
*/
fun <E, T : Iterable<E>> Assert<T>.atLeast(times: Int, f: (Assert<E>) -> Unit) =
Expand All @@ -239,7 +239,7 @@ fun <E, T : Iterable<E>> Assert<T>.atLeast(times: Int, f: (Assert<E>) -> Unit) =
* The given lambda will be run for each item.
*
* ```
* assert(listOf(-2, -1, 1)).atMost(2) { it.isPositive() }
* assertThat(listOf(-2, -1, 1)).atMost(2) { it.isPositive() }
* ```
*/
fun <E, T : Iterable<E>> Assert<T>.atMost(times: Int, f: (Assert<E>) -> Unit) =
Expand All @@ -254,7 +254,7 @@ fun <E, T : Iterable<E>> Assert<T>.atMost(times: Int, f: (Assert<E>) -> Unit) =
* The given lambda will be run for each item.
*
* ```
* assert(listOf(-1, 1, 2)).exactly(2) { it.isPositive() }
* assertThat(listOf(-1, 1, 2)).exactly(2) { it.isPositive() }
* ```
*/
fun <E, T : Iterable<E>> Assert<T>.exactly(times: Int, f: (Assert<E>) -> Unit) =
Expand All @@ -269,7 +269,7 @@ fun <E, T : Iterable<E>> Assert<T>.exactly(times: Int, f: (Assert<E>) -> Unit) =
* The given lambda will be run for each item.
*
* ```
* assert(listOf(-1, -2, 1)).any { it.isPositive() }
* assertThat(listOf(-1, -2, 1)).any { it.isPositive() }
* ```
*/
fun <E, T : Iterable<E>> Assert<T>.any(f: (Assert<E>) -> Unit) =
Expand Down Expand Up @@ -330,4 +330,4 @@ fun <E, T : Iterable<E>> Assert<T>.single(): Assert<E> {
expected("to have single element but was empty")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import assertk.assertions.support.expected
*
* ```
* val divisibleBy5 : (Int) -> Boolean = { it % 5 == 0 }
* assert(10).matchesPredicate(divisibleBy5)
* assertThat(10).matchesPredicate(divisibleBy5)
* ```
*/
fun <T> Assert<T>.matchesPredicate(f: (T) -> Boolean) = given { actual ->
Expand Down
8 changes: 4 additions & 4 deletions assertk/src/commonMain/kotlin/assertk/assertions/sequence.kt
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ fun <E> Assert<Sequence<E>>.none(f: (Assert<E>) -> Unit) =
* The given lambda will be run for each item.
*
* ```
* assert(sequenceOf(-1, 1, 2)).atLeast(2) { it.isPositive() }
* assertThat(sequenceOf(-1, 1, 2)).atLeast(2) { it.isPositive() }
* ```
*/
fun <E, T : Sequence<E>> Assert<T>.atLeast(times: Int, f: (Assert<E>) -> Unit) =
Expand All @@ -260,7 +260,7 @@ fun <E, T : Sequence<E>> Assert<T>.atLeast(times: Int, f: (Assert<E>) -> Unit) =
* The given lambda will be run for each item.
*
* ```
* assert(sequenceOf(-2, -1, 1)).atMost(2) { it.isPositive() }
* assertThat(sequenceOf(-2, -1, 1)).atMost(2) { it.isPositive() }
* ```
*/
fun <E, T : Sequence<E>> Assert<T>.atMost(times: Int, f: (Assert<E>) -> Unit) =
Expand All @@ -275,7 +275,7 @@ fun <E, T : Sequence<E>> Assert<T>.atMost(times: Int, f: (Assert<E>) -> Unit) =
* The given lambda will be run for each item.
*
* ```
* assert(sequenceOf(-1, 1, 2)).exactly(2) { it.isPositive() }
* assertThat(sequenceOf(-1, 1, 2)).exactly(2) { it.isPositive() }
* ```
*/
fun <E, T : Sequence<E>> Assert<T>.exactly(times: Int, f: (Assert<E>) -> Unit) =
Expand All @@ -290,7 +290,7 @@ fun <E, T : Sequence<E>> Assert<T>.exactly(times: Int, f: (Assert<E>) -> Unit) =
* The given lambda will be run for each item.
*
* ```
* assert(sequenceOf(-1, -2, 1)).any { it.isPositive() }
* assertThat(sequenceOf(-1, -2, 1)).any { it.isPositive() }
* ```
*/
fun <E, T : Sequence<E>> Assert<T>.any(f: (Assert<E>) -> Unit) =
Expand Down

0 comments on commit 59a43f7

Please sign in to comment.