mirror of
https://github.com/jlengrand/atrium.git
synced 2026-03-10 08:01:19 +00:00
Remove @throws Assertion Error kdoc from assertion functions
This commit is contained in:
committed by
Robert Stoll
parent
3508b570bb
commit
831d279207
@@ -11,7 +11,6 @@ import ch.tutteli.kbox.glue
|
||||
* Expects that the subject of the assertion is (equal to) [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.toBe
|
||||
*/
|
||||
@@ -21,7 +20,6 @@ fun <T> Expect<T>.toBe(expected: T): Expect<T> = _logicAppend { toBe(expected) }
|
||||
* Expects that the subject of the assertion is not (equal to) [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.notToBe
|
||||
*/
|
||||
@@ -31,7 +29,6 @@ fun <T> Expect<T>.notToBe(expected: T): Expect<T> = _logicAppend { notToBe(expec
|
||||
* Expects that the subject of the assertion is the same instance as [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isSameAs
|
||||
*/
|
||||
@@ -41,7 +38,6 @@ fun <T> Expect<T>.isSameAs(expected: T): Expect<T> = _logicAppend { isSameAs(exp
|
||||
* Expects that the subject of the assertion is not the same instance as [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isNotSameAs
|
||||
*/
|
||||
@@ -67,7 +63,6 @@ fun <T> Expect<T>.because(reason: String, assertionCreator: Expect<T>.() -> Unit
|
||||
* is `null` or is not `null` and holds all assertions [assertionCreatorOrNull] creates.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.toBeNullIfNullGivenElse
|
||||
*/
|
||||
@@ -79,7 +74,6 @@ fun <T : Any> Expect<T?>.toBeNullIfNullGivenElse(
|
||||
* Expects that the subject of the assertion is not null and changes the subject to the non-nullable version.
|
||||
*
|
||||
* @return An [Expect] with the non-nullable type [T] (was `T?` before).
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.notToBeNullFeature
|
||||
*/
|
||||
@@ -91,7 +85,6 @@ inline fun <reified T : Any> Expect<T?>.notToBeNull(): Expect<T> =
|
||||
* that it holds all assertions the given [assertionCreator] creates.
|
||||
*
|
||||
* @return An [Expect] with the non-nullable type [T] (was `T?` before)
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.notToBeNull
|
||||
*/
|
||||
@@ -115,7 +108,6 @@ inline fun <reified T : Any> Expect<T?>.notToBeNull(noinline assertionCreator: E
|
||||
* `assert(listOf(1, 2)).isA<List<String>>{}` holds, even though `List<Int>` is clearly not a `List<String>`.
|
||||
*
|
||||
* @return An [Expect] with the new type [TSub].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isAFeature
|
||||
*/
|
||||
@@ -161,7 +153,6 @@ inline fun <reified TSub : Any> Expect<*>.isA(): Expect<TSub> =
|
||||
* `assert(listOf(1, 2)).isA<List<String>>{}` holds, even though `List<Int>` is clearly not a `List<String>`.
|
||||
*
|
||||
* @return An [Expect] with the new type [TSub].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isA
|
||||
*/
|
||||
@@ -200,7 +191,6 @@ infix fun <T> Expect<T>.and(assertionCreator: Expect<T>.() -> Unit): Expect<T> =
|
||||
* Expects that the subject of the assertion is not (equal to) [expected] and [otherValues].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*
|
||||
@@ -216,7 +206,6 @@ fun <T> Expect<T>.isNoneOf(expected: T, vararg otherValues: T): Expect<T> =
|
||||
* are passed. This function expects [IterableLike] (which is a typealias for [Any]) to avoid cluttering the API.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case the iterable is empty.
|
||||
*
|
||||
* @since 0.13.0
|
||||
|
||||
@@ -283,7 +283,7 @@ fun Expect<DoubleArray>.asList(): Expect<List<Double>> =
|
||||
* @return The newly created [Expect] for the transformed subject.
|
||||
*
|
||||
* @since 0.9.0
|
||||
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.doubleArrAsList
|
||||
*/
|
||||
@JvmName("doubleArrAsList")
|
||||
|
||||
@@ -58,7 +58,6 @@ val <T : CharSequence> Expect<T>.containsNot: NotCheckerStep<T, NotSearchBehavio
|
||||
* `contains("a", "a")`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] or one of the [otherExpected] is not a
|
||||
* [CharSequence], [Number] or [Char].
|
||||
*
|
||||
@@ -80,7 +79,6 @@ fun <T : CharSequence> Expect<T>.contains(
|
||||
* so that you can mix [String] and [Int] for instance.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.containsNot
|
||||
*/
|
||||
@@ -110,7 +108,6 @@ fun <T : CharSequence> Expect<T>.containsNot(
|
||||
* @param otherPatterns Additional patterns which are expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.containsRegexString
|
||||
*/
|
||||
@@ -138,7 +135,6 @@ fun <T : CharSequence> Expect<T>.containsRegex(pattern: String, vararg otherPatt
|
||||
* @param otherPatterns Additional patterns which are expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*
|
||||
@@ -151,7 +147,6 @@ fun <T : CharSequence> Expect<T>.containsRegex(pattern: Regex, vararg otherPatte
|
||||
* Expects that the subject of the assertion (a [CharSequence]) starts with [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.startsWith
|
||||
*/
|
||||
@@ -162,7 +157,6 @@ fun <T : CharSequence> Expect<T>.startsWith(expected: CharSequence): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [CharSequence]) starts with [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.startsWithChar
|
||||
*
|
||||
@@ -175,7 +169,6 @@ fun <T : CharSequence> Expect<T>.startsWith(expected: Char): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [CharSequence]) does not start with [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.startsNotWith
|
||||
*/
|
||||
@@ -186,7 +179,6 @@ fun <T : CharSequence> Expect<T>.startsNotWith(expected: CharSequence): Expect<T
|
||||
* Expects that the subject of the assertion (a [CharSequence]) does not start with [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*
|
||||
@@ -200,7 +192,6 @@ fun <T : CharSequence> Expect<T>.startsNotWith(expected: Char): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [CharSequence]) ends with [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.endsWith
|
||||
*/
|
||||
@@ -211,7 +202,6 @@ fun <T : CharSequence> Expect<T>.endsWith(expected: CharSequence): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [CharSequence]) ends with [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*
|
||||
@@ -224,7 +214,6 @@ fun <T : CharSequence> Expect<T>.endsWith(expected: Char): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [CharSequence]) does not end with [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.endsNotWith
|
||||
*/
|
||||
@@ -235,7 +224,6 @@ fun <T : CharSequence> Expect<T>.endsNotWith(expected: CharSequence): Expect<T>
|
||||
* Expects that the subject of the assertion (a [CharSequence]) does not end with [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.endsNotWithChar
|
||||
@@ -248,7 +236,6 @@ fun <T : CharSequence> Expect<T>.endsNotWith(expected: Char): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [CharSequence]) [CharSequence].[kotlin.text.isEmpty].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.isEmpty
|
||||
*/
|
||||
@@ -259,7 +246,6 @@ fun <T : CharSequence> Expect<T>.isEmpty(): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [CharSequence]) [CharSequence].[kotlin.text.isNotEmpty].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.isNotEmpty
|
||||
*/
|
||||
@@ -270,7 +256,6 @@ fun <T : CharSequence> Expect<T>.isNotEmpty(): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [CharSequence]) [CharSequence].[kotlin.text.isNotBlank].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.isNotBlank
|
||||
*/
|
||||
@@ -283,7 +268,6 @@ fun <T : CharSequence> Expect<T>.isNotBlank(): Expect<T> =
|
||||
* In contrast to [containsRegex] it does not look for a partial match but for an entire match.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*
|
||||
@@ -298,7 +282,6 @@ fun <T : CharSequence> Expect<T>.matches(expected: Regex): Expect<T> =
|
||||
* In contrast to `containsNot.regex` it does not look for a partial match but for an entire match.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*
|
||||
|
||||
@@ -37,7 +37,6 @@ import kotlin.jvm.JvmName
|
||||
* @param expected The value which is expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T> =
|
||||
@@ -66,7 +65,6 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.value(expected: CharS
|
||||
* @param otherExpected Additional values which are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] or one of the [otherExpected] is not a
|
||||
* [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@@ -91,7 +89,6 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.values(
|
||||
* @param expected The value which is expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@JvmName("valueIgnoringCase")
|
||||
@@ -122,7 +119,6 @@ fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.value(
|
||||
* @param otherExpected Additional values which are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] or one of the [otherExpected] is not a
|
||||
* [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@@ -148,7 +144,6 @@ fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.values(
|
||||
* @param expected The value which is expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T> =
|
||||
@@ -174,7 +169,6 @@ fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.value(expe
|
||||
* @param otherExpected Additional values which are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] or one of the [otherExpected] is not a
|
||||
* [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@@ -202,7 +196,6 @@ fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.values(
|
||||
* @param otherPatterns Additional patterns which are expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.regex(
|
||||
pattern: String,
|
||||
@@ -228,7 +221,6 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.regex(
|
||||
* @param otherPatterns Additional patterns which are expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -257,7 +249,6 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.regex(
|
||||
* @param otherPatterns Additional patterns which are expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
@JvmName("regexIgnoringCase")
|
||||
fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.regex(
|
||||
@@ -287,7 +278,6 @@ fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.regex(
|
||||
* @param otherPatterns Additional patterns which are expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.regex(
|
||||
pattern: String,
|
||||
@@ -309,7 +299,6 @@ fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.regex(
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
@@ -337,7 +326,6 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.elementsOf(
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
@@ -365,7 +353,6 @@ fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.elementsOf(
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
|
||||
@@ -34,7 +34,6 @@ import kotlin.jvm.JvmName
|
||||
* @param expected The value which is expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T> =
|
||||
@@ -63,7 +62,6 @@ fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.value(expected: Cha
|
||||
* @param otherExpected Additional values which are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] or one of the [otherExpected] is not a
|
||||
* [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@@ -88,7 +86,6 @@ fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.values(
|
||||
* @param expected The value which is expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@JvmName("valueIgnoringCase")
|
||||
@@ -119,7 +116,6 @@ fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.value(
|
||||
* @param otherExpected Additional values which are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] or one of the [otherExpected] is not a
|
||||
* [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@@ -145,7 +141,6 @@ fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.values(
|
||||
* @param expected The value which is expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T> =
|
||||
@@ -171,7 +166,6 @@ fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.value(expected: C
|
||||
* @param otherExpected Additional values which are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] or one of the [otherExpected] is not a
|
||||
* [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@@ -199,7 +193,6 @@ fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.values(
|
||||
* @param otherPatterns Additional patterns which are expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.regex(
|
||||
pattern: String,
|
||||
@@ -225,7 +218,6 @@ fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.regex(
|
||||
* @param otherPatterns Additional patterns which are expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -254,7 +246,6 @@ fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.regex(
|
||||
* @param otherPatterns Additional patterns which are expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
@JvmName("regexIgnoringCase")
|
||||
fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.regex(
|
||||
@@ -284,7 +275,6 @@ fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.regex(
|
||||
* @param otherPatterns Additional patterns which are expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.regex(
|
||||
pattern: String,
|
||||
@@ -307,7 +297,6 @@ fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.regex(
|
||||
* @param expectedIterable The [Iterable] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterable] is not a [CharSequence], [Number] or [Char] or the given
|
||||
* [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
@@ -337,7 +326,6 @@ fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.elementsOf(
|
||||
* @param expectedIterable The [Iterable] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterable] is not a [CharSequence], [Number] or [Char] or the given
|
||||
* [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
@@ -368,7 +356,6 @@ fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.elementsOf(
|
||||
* @param expectedIterable The [Iterable] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterable] is not a [CharSequence], [Number] or [Char] or the given
|
||||
* [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
@@ -398,7 +385,6 @@ fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.elementsOf(
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
@@ -426,7 +412,6 @@ fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.elementsOf(
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
@@ -455,7 +440,6 @@ fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.elementsOf(
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
|
||||
@@ -12,7 +12,6 @@ import ch.tutteli.kbox.identity
|
||||
* Expects that the subject of the assertion (a [Collection]) is an empty [Collection].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CollectionAssertionSamples.isEmpty
|
||||
*/
|
||||
@@ -23,7 +22,6 @@ fun <T : Collection<*>> Expect<T>.isEmpty(): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [Collection]) is not an empty [Collection].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CollectionAssertionSamples.isNotEmpty
|
||||
*/
|
||||
@@ -36,7 +34,6 @@ fun <T : Collection<*>> Expect<T>.isNotEmpty(): Expect<T> =
|
||||
* Shortcut for `size.toBe(expected)`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CollectionAssertionSamples.hasSize
|
||||
*/
|
||||
@@ -60,7 +57,6 @@ val <T : Collection<*>> Expect<T>.size: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CollectionAssertionSamples.size
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,6 @@ import ch.tutteli.atrium.logic.*
|
||||
* The comparison is carried out with [Comparable.compareTo].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ComparableAssertionSamples.isLessThan
|
||||
*/
|
||||
@@ -20,7 +19,6 @@ fun <T : Comparable<T>> Expect<T>.isLessThan(expected: T): Expect<T> =
|
||||
* The comparison is carried out with [Comparable.compareTo].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ComparableAssertionSamples.isLessThanOrEqual
|
||||
*/
|
||||
@@ -32,7 +30,6 @@ fun <T : Comparable<T>> Expect<T>.isLessThanOrEqual(expected: T): Expect<T> =
|
||||
* The comparison is carried out with [Comparable.compareTo].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ComparableAssertionSamples.isGreaterThan
|
||||
*/
|
||||
@@ -44,7 +41,6 @@ fun <T : Comparable<T>> Expect<T>.isGreaterThan(expected: T): Expect<T> =
|
||||
* The comparison is carried out with [Comparable.compareTo].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ComparableAssertionSamples.isGreaterThanOrEqual
|
||||
*/
|
||||
@@ -56,7 +52,6 @@ fun <T : Comparable<T>> Expect<T>.isGreaterThanOrEqual(expected: T): Expect<T> =
|
||||
* where the comparison is carried out with [Comparable.compareTo].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*
|
||||
|
||||
@@ -27,7 +27,6 @@ fun <T, R> Expect<T>.feature(property: KProperty1<in T, R>): FeatureExpect<T, R>
|
||||
* returns the initial [Expect] with the current subject.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case the created [AssertionGroup] does not hold.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -57,7 +56,6 @@ fun <T, R> Expect<T>.feature(f: KFunction1<T, R>): FeatureExpect<T, R> =
|
||||
* returns the initial [Expect] with the current subject.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case the created [AssertionGroup] does not hold.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -91,7 +89,6 @@ fun <T, A1, R> Expect<T>.feature(
|
||||
* returns the initial [Expect] with the current subject.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case the created [AssertionGroup] does not hold.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -126,7 +123,6 @@ fun <T, A1, A2, R> Expect<T>.feature(
|
||||
* returns the initial [Expect] with the current subject.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case the created [AssertionGroup] does not hold.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -161,7 +157,6 @@ fun <T, A1, A2, A3, R> Expect<T>.feature(
|
||||
* returns the initial [Expect] with the current subject.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case the created [AssertionGroup] does not hold.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -196,7 +191,6 @@ fun <T, A1, A2, A3, A4, R> Expect<T>.feature(
|
||||
* returns the initial [Expect] with the current subject.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case the created [AssertionGroup] does not hold.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -230,7 +224,6 @@ fun <T, A1, A2, A3, A4, A5, R> Expect<T>.feature(
|
||||
* returns the initial [Expect] with the current subject.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case the created [AssertionGroup] does not hold.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -268,7 +261,6 @@ fun <T, R> Expect<T>.feature(description: String, provider: T.() -> R): FeatureE
|
||||
* implicit parameter `it`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case the created [AssertionGroup] does not hold.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -307,7 +299,6 @@ fun <T, R> Expect<T>.feature(provider: MetaFeatureOption<T>.(T) -> MetaFeature<R
|
||||
* implicit parameter `it`. Usually you use [MetaFeatureOption.f] to create a [MetaFeature], e.g. `f(it::size)`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case the created [AssertionGroup] does not hold.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,6 @@ import kotlin.jvm.JvmName
|
||||
* | `subject of the assertion` - [expected] | ≤ [tolerance]
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.FloatingPointAssertionSamples.toBeWithErrorToleranceFloat
|
||||
*/
|
||||
@@ -38,7 +37,6 @@ fun Expect<Float>.toBeWithErrorTolerance(expected: Float, tolerance: Float): Exp
|
||||
* | `subject of the assertion` - [expected] | ≤ [tolerance]
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.FloatingPointAssertionSamples.toBeWithErrorToleranceDouble
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,6 @@ import ch.tutteli.atrium.logic.toThrow
|
||||
* the element type is actually `String`.
|
||||
*
|
||||
* @return An [Expect] with the new type [TExpected].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
inline fun <reified TExpected : Throwable> Expect<out () -> Any?>.toThrow(): Expect<TExpected> =
|
||||
_logic.toThrow(TExpected::class).transform()
|
||||
@@ -49,7 +48,6 @@ inline fun <reified TExpected : Throwable> Expect<out () -> Any?>.toThrow(): Exp
|
||||
* the element type is actually `String`.
|
||||
*
|
||||
* @return An [Expect] with the new type [TExpected].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
inline fun <reified TExpected : Throwable> Expect<out () -> Any?>.toThrow(
|
||||
noinline assertionCreator: Expect<TExpected>.() -> Unit
|
||||
@@ -61,7 +59,6 @@ inline fun <reified TExpected : Throwable> Expect<out () -> Any?>.toThrow(
|
||||
* and changes the subject of the assertion to the return value of type [R].
|
||||
*
|
||||
* @return An [Expect] with the new type [R].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <R, T : () -> R> Expect<T>.notToThrow(): Expect<R> =
|
||||
_logic.notToThrow().transform()
|
||||
@@ -71,7 +68,6 @@ fun <R, T : () -> R> Expect<T>.notToThrow(): Expect<R> =
|
||||
* and that the corresponding return value holds all assertions the given [assertionCreator] creates.
|
||||
*
|
||||
* @return An [Expect] with the new type [R].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <R, T : () -> R> Expect<T>.notToThrow(
|
||||
assertionCreator: Expect<R>.() -> Unit
|
||||
|
||||
@@ -48,7 +48,6 @@ val <E, T : Iterable<E>> Expect<T>.containsNot: NotCheckerStep<E, T, NotSearchBe
|
||||
* `contains('a', 'a')`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E, T : Iterable<E>> Expect<T>.contains(expected: E, vararg otherExpected: E): Expect<T> =
|
||||
contains.inAnyOrder.atLeast(1).values(expected, *otherExpected)
|
||||
@@ -65,7 +64,6 @@ fun <E, T : Iterable<E>> Expect<T>.contains(expected: E, vararg otherExpected: E
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> Expect<T>.contains(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T> =
|
||||
contains.inAnyOrder.atLeast(1).entry(assertionCreatorOrNull)
|
||||
@@ -85,7 +83,6 @@ fun <E : Any, T : Iterable<E?>> Expect<T>.contains(assertionCreatorOrNull: (Expe
|
||||
* which we are looking for (see [assertionCreatorOrNull] for more information).
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> Expect<T>.contains(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?,
|
||||
@@ -103,7 +100,6 @@ fun <E : Any, T : Iterable<E?>> Expect<T>.contains(
|
||||
* [#292](https://github.com/robstoll/atrium/issues/292) for more information)
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E, T : Iterable<E>> Expect<T>.containsExactly(expected: E, vararg otherExpected: E): Expect<T> =
|
||||
contains.inOrder.only.values(expected, *otherExpected)
|
||||
@@ -124,7 +120,6 @@ fun <E, T : Iterable<E>> Expect<T>.containsExactly(expected: E, vararg otherExpe
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T> =
|
||||
contains.inOrder.only.entry(assertionCreatorOrNull)
|
||||
@@ -148,7 +143,6 @@ fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(assertionCreatorOrNull
|
||||
* which we are looking for (see [assertionCreatorOrNull] for more information).
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?,
|
||||
@@ -167,7 +161,6 @@ fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
@@ -187,7 +180,6 @@ inline fun <reified E, T : Iterable<E>> Expect<T>.containsExactlyElementsOf(
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
@@ -204,7 +196,6 @@ inline fun <reified E, T : Iterable<E>> Expect<T>.containsElementsOf(
|
||||
* It is a shortcut for `containsNot.values(expected, *otherExpected)`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E, T : Iterable<E>> Expect<T>.containsNot(expected: E, vararg otherExpected: E): Expect<T> =
|
||||
containsNot.values(expected, *otherExpected)
|
||||
@@ -227,7 +218,6 @@ fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.min(): Expect<E> =
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -251,7 +241,6 @@ fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.max(): Expect<E> =
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -267,7 +256,6 @@ fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.max(assertionCreator: Expect<
|
||||
* It is a shortcut for `contains.inAnyOrder.atLeast(1).entry(assertionCreatorOrNull)`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> Expect<T>.any(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T> =
|
||||
contains.inAnyOrder.atLeast(1).entry(assertionCreatorOrNull)
|
||||
@@ -280,7 +268,6 @@ fun <E : Any, T : Iterable<E?>> Expect<T>.any(assertionCreatorOrNull: (Expect<E>
|
||||
* It is a shortcut for `containsNot.entry(assertionCreatorOrNull)`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> Expect<T>.none(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T> =
|
||||
containsNot.entry(assertionCreatorOrNull)
|
||||
@@ -291,7 +278,6 @@ fun <E : Any, T : Iterable<E?>> Expect<T>.none(assertionCreatorOrNull: (Expect<E
|
||||
* that all elements are `null` in case [assertionCreatorOrNull] is defined as `null`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> Expect<T>.all(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T> =
|
||||
_logicAppend { all(::identity, assertionCreatorOrNull) }
|
||||
@@ -301,7 +287,6 @@ fun <E : Any, T : Iterable<E?>> Expect<T>.all(assertionCreatorOrNull: (Expect<E>
|
||||
* Expects that the subject of the assertion (an [Iterable]) has at least one element.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -312,7 +297,6 @@ fun <E, T : Iterable<E>> Expect<T>.hasNext(): Expect<T> =
|
||||
* Expects that the subject of the assertion (an [Iterable]) does not have next element.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -323,7 +307,6 @@ fun <E, T : Iterable<E>> Expect<T>.hasNotNext(): Expect<T> =
|
||||
* Expects that the subject of the assertion (an [Iterable]) does not have duplicate elements.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,6 @@ import ch.tutteli.kbox.glue
|
||||
* @param expected The value which is expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E, T : Iterable<E>> CheckerOption<E, T, InAnyOrderSearchBehaviour>.value(expected: E): Expect<T> =
|
||||
values(expected)
|
||||
@@ -44,7 +43,6 @@ fun <E, T : Iterable<E>> CheckerOption<E, T, InAnyOrderSearchBehaviour>.value(ex
|
||||
* @param otherExpected Additional objects which are expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E, T : Iterable<E>> CheckerOption<E, T, InAnyOrderSearchBehaviour>.values(
|
||||
expected: E,
|
||||
@@ -63,7 +61,6 @@ fun <E, T : Iterable<E>> CheckerOption<E, T, InAnyOrderSearchBehaviour>.values(
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> CheckerOption<E?, T, InAnyOrderSearchBehaviour>.entry(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?
|
||||
@@ -82,7 +79,6 @@ fun <E : Any, T : Iterable<E?>> CheckerOption<E?, T, InAnyOrderSearchBehaviour>.
|
||||
* which we are looking for (see [assertionCreatorOrNull] for more information).
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> CheckerOption<E?, T, InAnyOrderSearchBehaviour>.entries(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?,
|
||||
@@ -104,7 +100,6 @@ fun <E : Any, T : Iterable<E?>> CheckerOption<E?, T, InAnyOrderSearchBehaviour>.
|
||||
* @param expectedIterable The [Iterable] whose elements are expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case the given [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
* @since 0.9.0
|
||||
@@ -130,7 +125,6 @@ inline fun <reified E, T : Iterable<E>> CheckerOption<E, T, InAnyOrderSearchBeha
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
|
||||
@@ -25,7 +25,6 @@ import ch.tutteli.kbox.glue
|
||||
* @param expected The value which is expected to be contained within the [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E, T : Iterable<E>> Builder<E, T, InAnyOrderOnlySearchBehaviour>.value(expected: E): Expect<T> =
|
||||
values(expected)
|
||||
@@ -44,7 +43,6 @@ fun <E, T : Iterable<E>> Builder<E, T, InAnyOrderOnlySearchBehaviour>.value(expe
|
||||
* @param otherExpected Additional values which are expected to be contained within [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E, T : Iterable<E>> Builder<E, T, InAnyOrderOnlySearchBehaviour>.values(
|
||||
expected: E,
|
||||
@@ -67,7 +65,6 @@ fun <E, T : Iterable<E>> Builder<E, T, InAnyOrderOnlySearchBehaviour>.values(
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> Builder<E?, T, InAnyOrderOnlySearchBehaviour>.entry(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?
|
||||
@@ -99,7 +96,6 @@ fun <E : Any, T : Iterable<E?>> Builder<E?, T, InAnyOrderOnlySearchBehaviour>.en
|
||||
* which we are looking for (see [assertionCreatorOrNull] for more information).
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> Builder<E?, T, InAnyOrderOnlySearchBehaviour>.entries(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?,
|
||||
@@ -125,7 +121,6 @@ fun <E : Any, T : Iterable<E?>> Builder<E?, T, InAnyOrderOnlySearchBehaviour>.en
|
||||
* @param expectedIterable The [Iterable] whose elements are expected to be contained within this [Iterable]
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case the given [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
* @since 0.9.0
|
||||
@@ -155,7 +150,6 @@ inline fun <reified E, T : Iterable<E>> Builder<E, T, InAnyOrderOnlySearchBehavi
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [Iterable]
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
|
||||
@@ -25,7 +25,6 @@ import ch.tutteli.kbox.glue
|
||||
* @param expected The value which is expected to be contained within the [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E, T : Iterable<E>> Builder<E, T, InOrderOnlySearchBehaviour>.value(expected: E): Expect<T> =
|
||||
values(expected)
|
||||
@@ -43,7 +42,6 @@ fun <E, T : Iterable<E>> Builder<E, T, InOrderOnlySearchBehaviour>.value(expecte
|
||||
* @param otherExpected Additional values which are expected to be contained within [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E, T : Iterable<E>> Builder<E, T, InOrderOnlySearchBehaviour>.values(
|
||||
expected: E,
|
||||
@@ -66,7 +64,6 @@ fun <E, T : Iterable<E>> Builder<E, T, InOrderOnlySearchBehaviour>.values(
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> Builder<E?, T, InOrderOnlySearchBehaviour>.entry(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?
|
||||
@@ -89,7 +86,6 @@ fun <E : Any, T : Iterable<E?>> Builder<E?, T, InOrderOnlySearchBehaviour>.entry
|
||||
* which we are looking for (see [assertionCreatorOrNull] for more information).
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E : Any, T : Iterable<E?>> Builder<E?, T, InOrderOnlySearchBehaviour>.entries(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?,
|
||||
@@ -115,7 +111,6 @@ fun <E : Any, T : Iterable<E?>> Builder<E?, T, InOrderOnlySearchBehaviour>.entri
|
||||
* @param expectedIterable The [Iterable] whose elements are expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case the given [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
* @since 0.9.0
|
||||
@@ -145,7 +140,6 @@ inline fun <reified E, T : Iterable<E>> Builder<E, T, InOrderOnlySearchBehaviour
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
|
||||
@@ -23,7 +23,6 @@ import kotlin.jvm.JvmName
|
||||
* [Iterable] whereas the groups have to appear in the given order.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <E, T : Iterable<E>> Builder<E, T, InOrderOnlyGroupedWithinSearchBehaviour>.inAnyOrder(
|
||||
firstGroup: Group<E>,
|
||||
@@ -52,7 +51,6 @@ fun <E, T : Iterable<E>> Builder<E, T, InOrderOnlyGroupedWithinSearchBehaviour>.
|
||||
* [Iterable] whereas the groups have to appear in the given order.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
@JvmName("inAnyOrderEntries")
|
||||
fun <E : Any, T : Iterable<E?>> Builder<E?, T, InOrderOnlyGroupedWithinSearchBehaviour>.inAnyOrder(
|
||||
|
||||
@@ -21,7 +21,6 @@ import ch.tutteli.kbox.glue
|
||||
* @param expected The value which is expected to be contained within this [IterableLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -47,7 +46,6 @@ fun <E, T: IterableLike> CheckerStep<E, T, InAnyOrderSearchBehaviour>.value(expe
|
||||
* @param otherExpected Additional objects which are expected to be contained within this [IterableLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -68,7 +66,6 @@ fun <E, T: IterableLike> CheckerStep<E, T, InAnyOrderSearchBehaviour>.values(
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -90,7 +87,6 @@ fun <E : Any, T: IterableLike> CheckerStep<out E?, T, InAnyOrderSearchBehaviour>
|
||||
* which we are looking for (see [assertionCreatorOrNull] for more information).
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -114,7 +110,6 @@ fun <E : Any, T: IterableLike> CheckerStep<out E?, T, InAnyOrderSearchBehaviour>
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [IterableLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not
|
||||
* an [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
|
||||
@@ -27,7 +27,6 @@ import ch.tutteli.kbox.glue
|
||||
* @param expected The value which is expected to be contained within the subject (an [IterableLike]).
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -47,7 +46,6 @@ fun <E, T: IterableLike> EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>.val
|
||||
* @param otherExpected Additional values which are expected to be contained within [IterableLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -72,7 +70,6 @@ fun <E, T: IterableLike> EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>.val
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -106,7 +103,6 @@ fun <E : Any, T: IterableLike> EntryPointStep<out E?, T, InAnyOrderOnlySearchBeh
|
||||
* which we are looking for (see [assertionCreatorOrNull] for more information).
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -132,7 +128,6 @@ fun <E : Any, T: IterableLike> EntryPointStep<out E?, T, InAnyOrderOnlySearchBeh
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [IterableLike]
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not
|
||||
* an [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
|
||||
@@ -25,7 +25,6 @@ import ch.tutteli.kbox.glue
|
||||
* @param expected The value which is expected to be contained within the subject (an [IterableLike]).
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -45,7 +44,6 @@ fun <E, T : IterableLike> EntryPointStep<E, T, InOrderOnlySearchBehaviour>.value
|
||||
* @param otherExpected Additional values which are expected to be contained within [IterableLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -70,7 +68,6 @@ fun <E, T : IterableLike> EntryPointStep<E, T, InOrderOnlySearchBehaviour>.value
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -96,7 +93,6 @@ fun <E : Any, T : IterableLike> EntryPointStep<out E?, T, InOrderOnlySearchBehav
|
||||
* which we are looking for (see [assertionCreatorOrNull] for more information).
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -122,7 +118,6 @@ fun <E : Any, T : IterableLike> EntryPointStep<out E?, T, InOrderOnlySearchBehav
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [IterableLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an
|
||||
* [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
|
||||
@@ -23,7 +23,6 @@ import kotlin.jvm.JvmName
|
||||
* [IterableLike] whereas the groups have to appear in the given order.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -49,7 +48,6 @@ fun <E, T: IterableLike> EntryPointStep<E, T, InOrderOnlyGroupedWithinSearchBeha
|
||||
* [IterableLike] whereas the groups have to appear in the given order.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,6 @@ import ch.tutteli.atrium.logic.hasNotNext
|
||||
* Expects that the subject of the assertion (an [Iterator]) has at least one element.
|
||||
*
|
||||
* @return an [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*
|
||||
@@ -22,7 +21,6 @@ fun <E, T : Iterator<E>> Expect<T>.hasNext(): Expect<T> =
|
||||
* Expects that the subject of the assertion (an [Iterator]) does not have a next element.
|
||||
*
|
||||
* @return an [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*
|
||||
|
||||
@@ -9,7 +9,6 @@ import ch.tutteli.atrium.logic.get
|
||||
* returns an [Expect] for the element at that position.
|
||||
*
|
||||
* @return The newly created [Expect] for the element at position [index].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given [index] is out of bound.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ListAssertionSamples.getFeature
|
||||
*/
|
||||
@@ -21,7 +20,6 @@ fun <E, T : List<E>> Expect<T>.get(index: Int): Expect<E> =
|
||||
* the element at that position holds all assertions the given [assertionCreator] creates for it.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given [index] is out of bound.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ListAssertionSamples.get
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,6 @@ val <K, V, T : Map<out K, V>> Expect<T>.contains: MapLikeContains.EntryPointStep
|
||||
* even though they match the same entry.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <K, V, T : Map<out K, V>> Expect<T>.contains(
|
||||
keyValuePair: Pair<K, V>,
|
||||
@@ -44,7 +43,6 @@ fun <K, V, T : Map<out K, V>> Expect<T>.contains(
|
||||
* Delegates to `contains.inAnyOrder.only.entries(keyValuePair, *otherPairs)`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <K, V, T : Map<out K, V>> Expect<T>.containsOnly(
|
||||
keyValuePair: Pair<K, V>,
|
||||
@@ -65,7 +63,6 @@ fun <K, V, T : Map<out K, V>> Expect<T>.containsOnly(
|
||||
* , then both match, even though they match the same entry.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
inline fun <K, reified V : Any, T : Map<out K, V?>> Expect<T>.contains(
|
||||
keyValue: KeyValue<K, V>,
|
||||
@@ -82,7 +79,6 @@ inline fun <K, reified V : Any, T : Map<out K, V?>> Expect<T>.contains(
|
||||
* Delegates to `contains.inAnyOrder.only.entries(keyValue, *otherKeyValues)`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
inline fun <K, reified V : Any, T : Map<out K, V?>> Expect<T>.containsOnly(
|
||||
keyValue: KeyValue<K, V>,
|
||||
@@ -95,7 +91,6 @@ inline fun <K, reified V : Any, T : Map<out K, V?>> Expect<T>.containsOnly(
|
||||
* Delegates to ` contains.inAnyOrder.entriesOf`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <K, V : Any, T : Map<out K, V?>> Expect<T>.containsEntriesOf(
|
||||
mapLike: MapLike
|
||||
@@ -108,7 +103,6 @@ fun <K, V : Any, T : Map<out K, V?>> Expect<T>.containsEntriesOf(
|
||||
* Delegates to `contains.inAnyOrder.only.entriesOf`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <K, V : Any, T : Map<out K, V?>> Expect<T>.containsOnlyEntriesOf(
|
||||
mapLike: MapLike
|
||||
@@ -118,7 +112,6 @@ fun <K, V : Any, T : Map<out K, V?>> Expect<T>.containsOnlyEntriesOf(
|
||||
* Expects that the subject of the assertion (a [Map]) contains the given [key].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <K, T : Map<out K, *>> Expect<T>.containsKey(key: K): Expect<T> =
|
||||
_logicAppend { containsKey(::identity, key) }
|
||||
@@ -127,7 +120,6 @@ fun <K, T : Map<out K, *>> Expect<T>.containsKey(key: K): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [Map]) does not contain the given [key].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <K, T : Map<out K, *>> Expect<T>.containsNotKey(key: K): Expect<T> =
|
||||
_logicAppend { containsNotKey(::identity, key) }
|
||||
@@ -138,7 +130,6 @@ fun <K, T : Map<out K, *>> Expect<T>.containsNotKey(key: K): Expect<T> =
|
||||
* so that further fluent calls are assertions about it.
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given [key] does not exist.
|
||||
*/
|
||||
fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: K): Expect<V> =
|
||||
_logic.getExisting(::identity, key).transform()
|
||||
@@ -148,8 +139,6 @@ fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: K): Expect<V> =
|
||||
* the corresponding value holds all assertions the given [assertionCreator] creates for it.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if a created [Assertion]s (by calling [assertionCreator])
|
||||
* does not hold.
|
||||
*/
|
||||
fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: K, assertionCreator: Expect<V>.() -> Unit): Expect<T> =
|
||||
_logic.getExisting(::identity, key).collectAndAppend(assertionCreator)
|
||||
@@ -169,7 +158,6 @@ val <K, T : Map<out K, *>> Expect<T>.keys: Expect<Set<K>>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <K, V, T : Map<out K, V>> Expect<T>.keys(assertionCreator: Expect<Set<K>>.() -> Unit): Expect<T> =
|
||||
_logic.property(Map<out K, *>::keys).collectAndAppend(assertionCreator)
|
||||
@@ -189,7 +177,6 @@ val <V, T : Map<*, V>> Expect<T>.values: Expect<Collection<V>>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <K, V, T : Map<out K, V>> Expect<T>.values(assertionCreator: Expect<Collection<V>>.() -> Unit): Expect<T> =
|
||||
_logic.property(Map<out K, V>::values).collectAndAppend(assertionCreator)
|
||||
@@ -224,7 +211,6 @@ fun <K, V, T : Map<out K, V>> Expect<T>.asEntries(
|
||||
* Expects that the subject of the assertion (a [Map]) is an empty [Map].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : Map<*, *>> Expect<T>.isEmpty(): Expect<T> =
|
||||
_logicAppend { isEmpty(::toEntries) }
|
||||
@@ -234,7 +220,6 @@ fun <T : Map<*, *>> Expect<T>.isEmpty(): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [Map]) is not an empty [Map].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : Map<*, *>> Expect<T>.isNotEmpty(): Expect<T> =
|
||||
_logicAppend { isNotEmpty(::toEntries) }
|
||||
|
||||
@@ -22,7 +22,6 @@ val <T : Map<*, *>> Expect<T>.size: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,6 @@ import ch.tutteli.atrium.logic.*
|
||||
* reporting etc.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <K, V, T : Map.Entry<K, V>> Expect<T>.isKeyValue(key: K, value: V): Expect<T> =
|
||||
_logicAppend { isKeyValue(key, value) }
|
||||
@@ -32,7 +31,6 @@ val <K, T : Map.Entry<K, *>> Expect<T>.key: Expect<K>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <K, V, T : Map.Entry<K, V>> Expect<T>.key(assertionCreator: Expect<K>.() -> Unit): Expect<T> =
|
||||
_logic.key().collectAndAppend(assertionCreator)
|
||||
@@ -52,7 +50,6 @@ val <V, T : Map.Entry<*, V>> Expect<T>.value: Expect<V>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <K, V, T : Map.Entry<K, V>> Expect<T>.value(assertionCreator: Expect<V>.() -> Unit): Expect<T> =
|
||||
_logic.value().collectAndAppend(assertionCreator)
|
||||
|
||||
@@ -18,7 +18,6 @@ import ch.tutteli.kbox.glue
|
||||
* Delegates to [entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -35,7 +34,6 @@ fun <K, V, T : MapLike> EntryPointStep<K, V, T, InAnyOrderSearchBehaviour>.entry
|
||||
* even though they match the same entry.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -54,7 +52,6 @@ fun <K, V, T : MapLike> EntryPointStep<K, V, T, InAnyOrderSearchBehaviour>.entri
|
||||
* Delegates to [entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -75,7 +72,6 @@ inline fun <K, reified V : Any, T : MapLike> EntryPointStep<K, out V?, T, InAnyO
|
||||
* , then both match, even though they match the same entry.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -101,7 +97,6 @@ inline fun <K, reified V : Any, T : MapLike> EntryPointStep<K, out V?, T, InAnyO
|
||||
* @param expectedMapLike The [MapLike] whose elements are expected to be contained within this [MapLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedMapLike] is not
|
||||
* a [Map], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedMapLike] does not have elements (is empty).
|
||||
|
||||
@@ -18,7 +18,6 @@ import ch.tutteli.kbox.glue
|
||||
* Delegates to [entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -32,7 +31,6 @@ fun <K, V, T : MapLike> EntryPointStep<K, V, T, InAnyOrderOnlySearchBehaviour>.e
|
||||
* in which order they appear.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -51,7 +49,6 @@ fun <K, V, T : MapLike> EntryPointStep<K, V, T, InAnyOrderOnlySearchBehaviour>.e
|
||||
* Delegates to [entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -68,7 +65,6 @@ inline fun <K, reified V : Any, T : MapLike> EntryPointStep<K, out V?, T, InAnyO
|
||||
* [KeyValue.valueAssertionCreatorOrNull] is defined as `null`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -94,7 +90,6 @@ inline fun <K, reified V : Any, T : MapLike> EntryPointStep<K, out V?, T, InAnyO
|
||||
* @param expectedMapLike The [MapLike] whose elements are expected to be contained within this [MapLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedMapLike] is not
|
||||
* a [Map], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedMapLike] does not have elements (is empty).
|
||||
|
||||
@@ -21,7 +21,6 @@ import ch.tutteli.kbox.glue
|
||||
* Delegates to [entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -34,7 +33,6 @@ fun <K, V, T : MapLike> EntryPointStep<K, V, T, InOrderOnlySearchBehaviour>.entr
|
||||
* needs to contain only the given [keyValuePair] as well as the [otherPairs] in the specified order.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -54,7 +52,6 @@ fun <K, V, T : MapLike> EntryPointStep<K, V, T, InOrderOnlySearchBehaviour>.entr
|
||||
* Delegates to [entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -72,7 +69,6 @@ inline fun <K, reified V : Any, T : MapLike> EntryPointStep<K, out V?, T, InOrde
|
||||
* [KeyValue.valueAssertionCreatorOrNull] is defined as `null`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -96,7 +92,6 @@ inline fun <K, reified V : Any, T : MapLike> EntryPointStep<K, out V?, T, InOrde
|
||||
* This function expects [MapLike] (which is a typealias for [Any]) to avoid cluttering the API.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedMapLike] is not
|
||||
* a [Map], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedMapLike] does not have elements (is empty).
|
||||
|
||||
@@ -22,7 +22,6 @@ val <K, T : Pair<K, *>> Expect<T>.first: Expect<K>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.PairAssertionSamples.first
|
||||
*/
|
||||
@@ -46,7 +45,6 @@ val <V, T : Pair<*, V>> Expect<T>.second: Expect<V>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.PairAssertionSamples.second
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,6 @@ import ch.tutteli.atrium.logic.causeIsA
|
||||
* creates an [Expect] for it and returns it.
|
||||
*
|
||||
* @return The newly created [Expect] for the property [Throwable.message] of the subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
val <T : Throwable> Expect<T>.message: Expect<String>
|
||||
get() = feature(Throwable::message).notToBeNull()
|
||||
@@ -21,7 +20,6 @@ val <T : Throwable> Expect<T>.message: Expect<String>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : Throwable> Expect<T>.message(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
|
||||
feature(Throwable::message) { notToBeNull(assertionCreator) }
|
||||
@@ -39,7 +37,6 @@ fun <T : Throwable> Expect<T>.message(assertionCreator: Expect<String>.() -> Uni
|
||||
* so that you can mix [String] and [Int] for instance.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : Throwable> Expect<T>.messageContains(
|
||||
expected: CharSequenceOrNumberOrChar,
|
||||
@@ -52,7 +49,6 @@ fun <T : Throwable> Expect<T>.messageContains(
|
||||
* creates an [Expect] of the [TExpected] type for it and returns it.
|
||||
*
|
||||
* @return The newly created [Expect] for the property [Throwable.cause] of the subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
*/
|
||||
@@ -68,7 +64,6 @@ inline fun <reified TExpected : Throwable> Expect<out Throwable>.cause(): Expect
|
||||
* [Expect] of the initial type, which was some type `T `, but an [Expect] of the specified type [TExpected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
*/
|
||||
|
||||
@@ -49,7 +49,6 @@ fun <T : BigDecimal?> Expect<T>.toBe(expected: T): Nothing = throw PleaseUseRepl
|
||||
* Expects that the subject of the assertion (a [BigDecimal]) is `null`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.BigDecimalAssertionSamples.toBe
|
||||
*/
|
||||
@@ -92,7 +91,6 @@ fun <T : BigDecimal> Expect<T>.notToBe(expected: T): Nothing = throw PleaseUseRe
|
||||
* - `expect(BigDecimal("10")).isNumericallyEqualTo(BigDecimal("10.0"))` holds.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : BigDecimal> Expect<T>.isNumericallyEqualTo(expected: T): Expect<T> =
|
||||
_logicAppend { isNumericallyEqualTo(expected) }
|
||||
@@ -110,7 +108,6 @@ fun <T : BigDecimal> Expect<T>.isNumericallyEqualTo(expected: T): Expect<T> =
|
||||
* - `expect(BigDecimal("10")).isNotNumericallyEqualTo(BigDecimal("10.0"))` does not hold.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : BigDecimal> Expect<T>.isNotNumericallyEqualTo(expected: T): Expect<T> =
|
||||
_logicAppend { isNotNumericallyEqualTo(expected) }
|
||||
@@ -125,7 +122,6 @@ fun <T : BigDecimal> Expect<T>.isNotNumericallyEqualTo(expected: T): Expect<T> =
|
||||
* - `expect(BigDecimal("10")).isNumericallyEqualTo(BigDecimal("10.0"))` holds.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : BigDecimal> Expect<T>.isEqualIncludingScale(expected: T): Expect<T> =
|
||||
_logicAppend { isEqualIncludingScale(expected, this::isNumericallyEqualTo.name) }
|
||||
@@ -140,7 +136,6 @@ fun <T : BigDecimal> Expect<T>.isEqualIncludingScale(expected: T): Expect<T> =
|
||||
* - `expect(BigDecimal("10")).isNotNumericallyEqualTo(BigDecimal("10.0"))` does not hold.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : BigDecimal> Expect<T>.isNotEqualIncludingScale(expected: T): Expect<T> =
|
||||
_logicAppend { isNotEqualIncludingScale(expected) }
|
||||
|
||||
@@ -14,7 +14,6 @@ import java.time.chrono.ChronoLocalDate
|
||||
* is before the [expected] [ChronoLocalDate].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -26,7 +25,6 @@ fun <T : ChronoLocalDate> Expect<T>.isBefore(expected: ChronoLocalDate): Expect<
|
||||
* is before or equal the [expected] [ChronoLocalDate].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -38,7 +36,6 @@ fun <T : ChronoLocalDate> Expect<T>.isBeforeOrEqual(expected: ChronoLocalDate):
|
||||
* is after the [expected] [ChronoLocalDate].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -50,7 +47,6 @@ fun <T : ChronoLocalDate> Expect<T>.isAfter(expected: ChronoLocalDate): Expect<T
|
||||
* is after or equal the [expected] [ChronoLocalDate].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -62,7 +58,6 @@ fun <T : ChronoLocalDate> Expect<T>.isAfterOrEqual(expected: ChronoLocalDate): E
|
||||
* is equal to the [expected] [ChronoLocalDate].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -75,7 +70,6 @@ fun <T : ChronoLocalDate> Expect<T>.isEqual(expected: ChronoLocalDate): Expect<T
|
||||
* The [expected] parameter needs to be in the form of **yyyy-mm-dd** or else a [java.time.DateTimeException] will be thrown.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -88,7 +82,6 @@ fun <T : ChronoLocalDate> Expect<T>.isBefore(expected: String): Expect<T> =
|
||||
* The [expected] parameter needs to be in the form of **yyyy-mm-dd** or else a [java.time.DateTimeException] will be thrown.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -101,7 +94,6 @@ fun <T : ChronoLocalDate> Expect<T>.isBeforeOrEqual(expected: String): Expect<T>
|
||||
* The [expected] parameter needs to be in the form of **yyyy-mm-dd** or else a [java.time.DateTimeException] will be thrown.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -114,7 +106,6 @@ fun <T : ChronoLocalDate> Expect<T>.isAfter(expected: String): Expect<T> =
|
||||
* The [expected] parameter needs to be in the form of **yyyy-mm-dd** or else a [java.time.DateTimeException] will be thrown.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -127,7 +118,6 @@ fun <T : ChronoLocalDate> Expect<T>.isAfterOrEqual(expected: String): Expect<T>
|
||||
* The [expected] parameter needs to be in the form of **yyyy-mm-dd** or else a [java.time.DateTimeException] will be thrown.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.time.chrono.ChronoLocalDateTime
|
||||
* is before the [expected] [ChronoLocalDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -29,7 +28,6 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBefore(
|
||||
* is before or equal the [expected] [ChronoLocalDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -42,7 +40,6 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqual(
|
||||
* is after the [expected] [ChronoLocalDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -55,7 +52,6 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
* is after or equal the [expected] [ChronoLocalDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -68,7 +64,6 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqual(
|
||||
* is equal to the [expected] [ChronoLocalDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -88,7 +83,6 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isEqual(
|
||||
* yyyy-mm-dd
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
@@ -108,7 +102,6 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBefore(
|
||||
* yyyy-mm-dd
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
@@ -128,7 +121,6 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqual(
|
||||
* yyyy-mm-dd
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
@@ -148,7 +140,6 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
* yyyy-mm-dd
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
@@ -168,7 +159,6 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqual(
|
||||
* yyyy-mm-dd
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,6 @@ import java.time.chrono.ChronoZonedDateTime
|
||||
* is before the [expected] [ChronoZonedDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -28,7 +27,6 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBefore(
|
||||
* is before or equals the [expected] [ChronoZonedDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -41,7 +39,6 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqual(
|
||||
* is after the [expected] [ChronoZonedDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -54,7 +51,6 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
* is after or equal the [expected] [ChronoZonedDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -67,7 +63,6 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqual(
|
||||
* is equal to the [expected] [ChronoZonedDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -101,7 +96,6 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isEqual(
|
||||
* - 2020-01-02+01:30
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -135,7 +129,6 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBefore(
|
||||
* - 2020-01-02+01:30
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -169,7 +162,6 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqual(
|
||||
* - 2020-01-02+01:30
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -203,7 +195,6 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
* - 2020-01-02+01:30
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -237,7 +228,6 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqual(
|
||||
* - 2020-01-02+01:30
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.math.BigDecimal
|
||||
* | `subject of the assertion` - [expected] | ≤ [tolerance]
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <T : BigDecimal> Expect<T>.toBeWithErrorTolerance(expected: BigDecimal, tolerance: BigDecimal): Expect<T> =
|
||||
_logicAppend { toBeWithErrorTolerance(expected, tolerance) }
|
||||
|
||||
@@ -26,7 +26,6 @@ val Expect<LocalDate>.year: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -50,7 +49,6 @@ val Expect<LocalDate>.month: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -74,7 +72,6 @@ val Expect<LocalDate>.dayOfWeek: Expect<DayOfWeek>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -99,7 +96,6 @@ val Expect<LocalDate>.day: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,6 @@ val Expect<LocalDateTime>.year: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -51,7 +50,6 @@ val Expect<LocalDateTime>.month: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -75,7 +73,6 @@ val Expect<LocalDateTime>.dayOfWeek: Expect<DayOfWeek>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -99,7 +96,6 @@ val Expect<LocalDateTime>.day: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.util.*
|
||||
* depends on the underlying implementation though.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -34,7 +33,6 @@ fun <T : Optional<*>> Expect<T>.isEmpty(): Expect<T> =
|
||||
* depends on the underlying implementation though.
|
||||
*
|
||||
* @return The newly created [Expect] for the inner type [E].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given assertion is not a success.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -46,7 +44,6 @@ fun <E, T : Optional<E>> Expect<T>.isPresent(): Expect<E> =
|
||||
* that it holds all assertions the given [assertionCreator] creates.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given assertions are not success.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,6 @@ import java.nio.file.Path
|
||||
* Expects that the subject of the assertion (a [Path]) starts with the [expected] [Path].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -26,7 +25,6 @@ fun <T : Path> Expect<T>.startsWith(expected: Path): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [Path]) does not start with the [expected] [Path].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -37,7 +35,6 @@ fun <T : Path> Expect<T>.startsNotWith(expected: Path): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [Path]) ends with the expected [Path].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -49,7 +46,6 @@ fun <T : Path> Expect<T>.endsWith(expected: Path): Expect<T> =
|
||||
*
|
||||
* @param expected The [Path] provided to the assertion
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -64,7 +60,6 @@ fun <T : Path> Expect<T>.endsNotWith(expected: Path): Expect<T> =
|
||||
* then the search will continue at that location.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -79,7 +74,6 @@ fun <T : Path> Expect<T>.exists(): Expect<T> =
|
||||
* then the search will continue at that location.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -105,7 +99,6 @@ val <T : Path> Expect<T>.fileName: Expect<String>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -118,7 +111,6 @@ fun <T : Path> Expect<T>.fileName(assertionCreator: Expect<String>.() -> Unit):
|
||||
* so that further fluent calls are assertions about it.
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -132,7 +124,6 @@ val <T : Path> Expect<T>.fileNameWithoutExtension: Expect<String>
|
||||
* and returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -144,7 +135,6 @@ fun <T : Path> Expect<T>.fileNameWithoutExtension(assertionCreator: Expect<Strin
|
||||
* so that further fluent calls are assertions about it.
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -156,7 +146,6 @@ val <T : Path> Expect<T>.parent: Expect<Path>
|
||||
* given [assertionCreator] creates for it and returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -168,7 +157,6 @@ fun <T : Path> Expect<T>.parent(assertionCreator: Expect<Path>.() -> Unit): Expe
|
||||
* so that further fluent calls are assertions about it.
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
*/
|
||||
@@ -180,7 +168,6 @@ fun <T : Path> Expect<T>.resolve(other: String): Expect<Path> =
|
||||
* given [assertionCreator] creates for it and returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
*/
|
||||
@@ -201,7 +188,6 @@ fun <T : Path> Expect<T>.resolve(other: String, assertionCreator: Expect<Path>.(
|
||||
* take place.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -218,7 +204,6 @@ fun <T : Path> Expect<T>.isReadable(): Expect<T> =
|
||||
* at the location the link points at.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -240,7 +225,6 @@ fun <T : Path> Expect<T>.isWritable(): Expect<T> =
|
||||
* at the location the link points at.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -260,7 +244,6 @@ fun <T : Path> Expect<T>.isExecutable(): Expect<T> =
|
||||
* take place.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -280,7 +263,6 @@ fun <T : Path> Expect<T>.isRegularFile(): Expect<T> =
|
||||
* take place.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -292,7 +274,6 @@ fun <T : Path> Expect<T>.isDirectory(): Expect<T> =
|
||||
* meaning that the [Path] specified in this instance starts at the file system root.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -304,7 +285,6 @@ fun <T : Path> Expect<T>.isAbsolute(): Expect<T> =
|
||||
* meaning that the [Path] specified in this instance does not start at the file system root.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -326,7 +306,6 @@ fun <T : Path> Expect<T>.isRelative(): Expect<T> =
|
||||
* take place.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -352,7 +331,6 @@ val <T : Path> Expect<T>.extension: Expect<String>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -367,7 +345,6 @@ fun <T : Path> Expect<T>.extension(assertionCreator: Expect<String>.() -> Unit):
|
||||
* @param targetCharset target file encoding - UTF-8 per default.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -382,7 +359,6 @@ fun <T : Path> Expect<T>.hasSameTextualContentAs(
|
||||
* as [targetPath].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,6 @@ val Expect<ZonedDateTime>.year: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -51,7 +50,6 @@ val Expect<ZonedDateTime>.month: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -75,7 +73,6 @@ val Expect<ZonedDateTime>.dayOfWeek: Expect<DayOfWeek>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -99,7 +96,6 @@ val Expect<ZonedDateTime>.day: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,6 @@ import ch.tutteli.atrium.logic.kotlin_1_3.isSuccess
|
||||
* and returns an [Expect] for the inner type [E].
|
||||
*
|
||||
* @return The newly created [Expect] if the given assertion is success
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given assertion is not a success.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -22,7 +21,6 @@ fun <E, T : Result<E>> Expect<T>.isSuccess(): Expect<E> =
|
||||
* that it holds all assertions the given [assertionCreator] creates.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given assertions are not success.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -34,7 +32,6 @@ fun <E, T : Result<E>> Expect<T>.isSuccess(assertionCreator: Expect<E>.() -> Uni
|
||||
* that it encapsulates an exception of type [TExpected].
|
||||
*
|
||||
* @return An [Expect] with the new type [TExpected]
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
@@ -47,7 +44,6 @@ inline fun <reified TExpected : Throwable> Expect<out Result<*>>.isFailure(): Ex
|
||||
* holds all assertions the given [assertionCreator] creates.
|
||||
*
|
||||
* @return An [Expect] with the new type [TExpected]
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.9.0
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,6 @@ import ch.tutteli.atrium.reporting.Reporter
|
||||
* Expects that the subject of the assertion is (equal to) [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.AnyAssertionSamples.toBe
|
||||
*/
|
||||
@@ -22,7 +21,6 @@ infix fun <T> Expect<T>.toBe(expected: T): Expect<T> = _logicAppend { toBe(expec
|
||||
* Expects that the subject of the assertion is not (equal to) [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T> Expect<T>.notToBe(expected: T): Expect<T> = _logicAppend { notToBe(expected) }
|
||||
|
||||
@@ -30,7 +28,6 @@ infix fun <T> Expect<T>.notToBe(expected: T): Expect<T> = _logicAppend { notToBe
|
||||
* Expects that the subject of the assertion is the same instance as [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T> Expect<T>.isSameAs(expected: T): Expect<T> = _logicAppend { isSameAs(expected) }
|
||||
|
||||
@@ -38,7 +35,6 @@ infix fun <T> Expect<T>.isSameAs(expected: T): Expect<T> = _logicAppend { isSame
|
||||
* Expects that the subject of the assertion is not the same instance as [expected].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T> Expect<T>.isNotSameAs(expected: T): Expect<T> = _logicAppend { isNotSameAs(expected) }
|
||||
|
||||
@@ -67,7 +63,6 @@ fun <T> of(reason: String, assertionCreator: Expect<T>.() -> Unit): KeyWithCreat
|
||||
* is `null` or is not `null` and holds all assertions [assertionCreatorOrNull] creates.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Any> Expect<T?>.toBeNullIfNullGivenElse(
|
||||
assertionCreatorOrNull: (Expect<T>.() -> Unit)?
|
||||
@@ -80,7 +75,6 @@ infix fun <T : Any> Expect<T?>.toBeNullIfNullGivenElse(
|
||||
* @param o The filler object [o].
|
||||
*
|
||||
* @return An [Expect] with the non-nullable type [T] (was `T?` before).
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -93,7 +87,6 @@ inline infix fun <reified T : Any> Expect<T?>.notToBeNull(@Suppress("UNUSED_PARA
|
||||
* that it holds all assertions the given [assertionCreator] creates.
|
||||
*
|
||||
* @return An [Expect] with the non-nullable type [T] (was `T?` before)
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
@Suppress(/* less magic */ "RemoveExplicitTypeArguments")
|
||||
inline infix fun <reified T : Any> Expect<T?>.notToBeNull(noinline assertionCreator: Expect<T>.() -> Unit): Expect<T> =
|
||||
@@ -116,7 +109,6 @@ inline infix fun <reified T : Any> Expect<T?>.notToBeNull(noinline assertionCrea
|
||||
* `assert(listOf(1, 2)).isA<List<String>>{}` holds, even though `List<Int>` is clearly not a `List<String>`.
|
||||
*
|
||||
* @return An [Expect] with the new type [TSub].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
//TODO make infix and add `o` as parameter as soon as https://youtrack.jetbrains.com/issue/KT-21593 is fixed
|
||||
inline fun <reified TSub : Any> Expect<*>.isA(): Expect<TSub> =
|
||||
@@ -161,7 +153,6 @@ inline fun <reified TSub : Any> Expect<*>.isA(): Expect<TSub> =
|
||||
* `assert(listOf(1, 2)).isA<List<String>>{}` holds, even though `List<Int>` is clearly not a `List<String>`.
|
||||
*
|
||||
* @return An [Expect] with the new type [TSub].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
inline infix fun <reified TSub : Any> Expect<*>.isA(noinline assertionCreator: Expect<TSub>.() -> Unit): Expect<TSub> =
|
||||
_logic.isA(TSub::class).transformAndAppend(assertionCreator)
|
||||
@@ -248,7 +239,6 @@ inline val <T> Expect<T>.its: Expect<T> get() : Expect<T> = this
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
@@ -262,7 +252,6 @@ infix fun <T> Expect<T>.isNoneOf(values: Values<T>): Expect<T> =
|
||||
* are passed. This function expects [IterableLike] (which is a typealias for [Any]) to avoid cluttering the API.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case the iterable is empty.
|
||||
*
|
||||
* @since 0.13.0
|
||||
|
||||
@@ -52,7 +52,6 @@ infix fun <T : CharSequence> Expect<T>.containsNot(
|
||||
* so that you can mix [String] and [Int] for instance.
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.contains(expected: CharSequenceOrNumberOrChar): Expect<T> =
|
||||
@@ -83,7 +82,6 @@ infix fun <T : CharSequence> Expect<T>.contains(expected: CharSequenceOrNumberOr
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case one of the [values] is not a
|
||||
* [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@@ -100,7 +98,6 @@ infix fun <T : CharSequence> Expect<T>.contains(values: Values<CharSequenceOrNum
|
||||
* so that you can mix [String] and [Int] for instance.
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.containsNot(expected: CharSequenceOrNumberOrChar): Expect<T> =
|
||||
this containsNot o value expected
|
||||
@@ -118,7 +115,6 @@ infix fun <T : CharSequence> Expect<T>.containsNot(expected: CharSequenceOrNumbe
|
||||
* @param values The values which should not be found -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.containsNot(values: Values<CharSequenceOrNumberOrChar>): Expect<T> =
|
||||
this containsNot o the values
|
||||
@@ -132,7 +128,6 @@ infix fun <T : CharSequence> Expect<T>.containsNot(values: Values<CharSequenceOr
|
||||
* @param pattern The pattern which is expected to have a match against the input of the search.
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.containsRegex(pattern: String): Expect<T> =
|
||||
this contains o atLeast 1 regex pattern
|
||||
@@ -146,7 +141,6 @@ infix fun <T : CharSequence> Expect<T>.containsRegex(pattern: String): Expect<T>
|
||||
* @param pattern The pattern which is expected to have a match against the input of the search.
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.contains(pattern: Regex): Expect<T> =
|
||||
this contains o atLeast 1 matchFor pattern
|
||||
@@ -172,7 +166,6 @@ infix fun <T : CharSequence> Expect<T>.contains(pattern: Regex): Expect<T> =
|
||||
* use the function `regexPatterns(t, ...)` to create a [RegexPatterns].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.contains(regexPatterns: RegexPatterns): Expect<T> =
|
||||
this contains o atLeast 1 the regexPatterns
|
||||
@@ -199,7 +192,6 @@ infix fun <T : CharSequence> Expect<T>.contains(regexPatterns: RegexPatterns): E
|
||||
* use the function `all(Regex(...), ...)` to create a [All].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.contains(patterns: All<Regex>): Expect<T> =
|
||||
this contains o atLeast 1 matchFor patterns
|
||||
@@ -208,7 +200,6 @@ infix fun <T : CharSequence> Expect<T>.contains(patterns: All<Regex>): Expect<T>
|
||||
* Expects that the subject of the assertion (a [CharSequence]) starts with [expected].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.startsWith(expected: CharSequence): Expect<T> =
|
||||
_logicAppend { startsWith(expected) }
|
||||
@@ -217,7 +208,6 @@ infix fun <T : CharSequence> Expect<T>.startsWith(expected: CharSequence): Expec
|
||||
* Expects that the subject of the assertion (a [CharSequence]) starts with [expected].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -228,7 +218,6 @@ infix fun <T : CharSequence> Expect<T>.startsWith(expected: Char): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [CharSequence]) does not start with [expected].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.startsNotWith(expected: CharSequence): Expect<T> =
|
||||
_logicAppend { startsNotWith(expected) }
|
||||
@@ -237,7 +226,6 @@ infix fun <T : CharSequence> Expect<T>.startsNotWith(expected: CharSequence): Ex
|
||||
* Expects that the subject of the assertion (a [CharSequence]) does not start with [expected].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -249,7 +237,6 @@ infix fun <T : CharSequence> Expect<T>.startsNotWith(expected: Char): Expect<T>
|
||||
* Expects that the subject of the assertion (a [CharSequence]) ends with [expected].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.endsWith(expected: CharSequence): Expect<T> =
|
||||
_logicAppend { endsWith(expected) }
|
||||
@@ -258,7 +245,6 @@ infix fun <T : CharSequence> Expect<T>.endsWith(expected: CharSequence): Expect<
|
||||
* Expects that the subject of the assertion (a [CharSequence]) ends with [expected].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -269,7 +255,6 @@ infix fun <T : CharSequence> Expect<T>.endsWith(expected: Char): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [CharSequence]) does not end with [expected].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.endsNotWith(expected: CharSequence): Expect<T> =
|
||||
_logicAppend { endsNotWith(expected) }
|
||||
@@ -278,7 +263,6 @@ infix fun <T : CharSequence> Expect<T>.endsNotWith(expected: CharSequence): Expe
|
||||
* Expects that the subject of the assertion (a [CharSequence]) does not end with [expected].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -292,7 +276,6 @@ infix fun <T : CharSequence> Expect<T>.endsNotWith(expected: Char): Expect<T> =
|
||||
* @param empty Use the pseudo-keyword `empty`.
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") empty: empty): Expect<T> =
|
||||
_logicAppend { isEmpty() }
|
||||
@@ -303,7 +286,6 @@ infix fun <T : CharSequence> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") empty:
|
||||
* @param empty Use the pseudo-keyword `empty`.
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.notToBe(@Suppress("UNUSED_PARAMETER") empty: empty): Expect<T> =
|
||||
_logicAppend { isNotEmpty() }
|
||||
@@ -314,7 +296,6 @@ infix fun <T : CharSequence> Expect<T>.notToBe(@Suppress("UNUSED_PARAMETER") emp
|
||||
* @param blank Use the pseudo-keyword `blank`.
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.notToBe(@Suppress("UNUSED_PARAMETER") blank: blank): Expect<T> =
|
||||
_logicAppend { isNotBlank() }
|
||||
@@ -325,7 +306,6 @@ infix fun <T : CharSequence> Expect<T>.notToBe(@Suppress("UNUSED_PARAMETER") bla
|
||||
* In contrast to [containsRegex] it does not look for a partial match but for an entire match.
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -338,7 +318,6 @@ infix fun <T : CharSequence> Expect<T>.matches(expected: Regex): Expect<T> =
|
||||
* In contrast to `containsNot.regex` it does not look for a partial match but for an entire match.
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
|
||||
@@ -39,7 +39,6 @@ import kotlin.jvm.JvmName
|
||||
* @param expected The value which is expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
infix fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.value(
|
||||
@@ -69,7 +68,6 @@ infix fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.value(
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case one of the [values] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
infix fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.the(
|
||||
@@ -92,7 +90,6 @@ infix fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.the(
|
||||
* @param expected The value which is expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@JvmName("valueIgnoringCase")
|
||||
@@ -123,7 +120,6 @@ infix fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.value(
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case one of the [values] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@JvmName("valuesIgnoringCase")
|
||||
@@ -146,7 +142,6 @@ infix fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.the(
|
||||
* @param expected The value which is expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
infix fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.value(
|
||||
@@ -179,7 +174,6 @@ infix fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.valu
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case one of the [values] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
infix fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.the(
|
||||
@@ -195,7 +189,6 @@ infix fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.the(
|
||||
* @param pattern The pattern which is expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.regex(pattern: String): Expect<T> =
|
||||
this the regexPatterns(pattern)
|
||||
@@ -209,7 +202,6 @@ infix fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.regex(pattern:
|
||||
* @param pattern The pattern which is expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -236,7 +228,6 @@ infix fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.matchFor(
|
||||
* -- use the function `regexPatterns(t, ...)` to create a [RegexPatterns].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.the(patterns: RegexPatterns): Expect<T> =
|
||||
_logicAppend { regex(patterns.toList()) }
|
||||
@@ -260,7 +251,6 @@ infix fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.the(patterns: R
|
||||
* use the function `all(Regex(...), ...)` to create a [All].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -276,7 +266,6 @@ infix fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.matchFor(patter
|
||||
* @param pattern The patterns which is expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
@JvmName("regexIgnoringCase")
|
||||
infix fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.regex(pattern: String): Expect<T> =
|
||||
@@ -301,7 +290,6 @@ infix fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.regex(p
|
||||
* -- use the function `regexPatterns(t, ...)` to create a [RegexPatterns].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
@JvmName("regexIgnoringCase")
|
||||
infix fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.the(patterns: RegexPatterns): Expect<T> =
|
||||
@@ -316,7 +304,6 @@ infix fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.the(pat
|
||||
* @param pattern The patterns which is expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.regex(pattern: String): Expect<T> =
|
||||
this atLeast 1 regex pattern
|
||||
@@ -342,7 +329,6 @@ infix fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.rege
|
||||
* use the function `regexPatterns(t, ...)` to create a [RegexPatterns].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.the(patterns: RegexPatterns): Expect<T> =
|
||||
this atLeast 1 the patterns
|
||||
@@ -362,7 +348,6 @@ infix fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.the(
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
@@ -389,7 +374,6 @@ infix fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.elementsOf(
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
@@ -417,7 +401,6 @@ infix fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.element
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
|
||||
@@ -36,7 +36,6 @@ import kotlin.jvm.JvmName
|
||||
* @param expected The value which is expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.value(
|
||||
@@ -66,7 +65,6 @@ infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.value(
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case one of the [values] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.the(
|
||||
@@ -89,7 +87,6 @@ infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.the(
|
||||
* @param expected The value which is expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@JvmName("valueIgnoringCase")
|
||||
@@ -120,7 +117,6 @@ infix fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.value
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case one of the [values] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
@JvmName("valuesIgnoringCase")
|
||||
@@ -143,7 +139,6 @@ infix fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.the(
|
||||
* @param expected The value which is expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
infix fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.value(
|
||||
@@ -176,7 +171,6 @@ infix fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.value(
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case one of the [values] is not a [CharSequence], [Number] or [Char].
|
||||
*/
|
||||
infix fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.the(
|
||||
@@ -192,7 +186,6 @@ infix fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.the(
|
||||
* @param pattern The pattern which is expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.regex(pattern: String): Expect<T> =
|
||||
this the regexPatterns(pattern)
|
||||
@@ -206,7 +199,6 @@ infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.regex(pattern
|
||||
* @param pattern The pattern which is expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -233,7 +225,6 @@ infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.matchFor(
|
||||
* -- use the function `regexPatterns(t, ...)` to create a [RegexPatterns].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.the(patterns: RegexPatterns): Expect<T> =
|
||||
addAssertion(ExpectImpl.charSequence.contains.regex(this, patterns.toList()))
|
||||
@@ -257,7 +248,6 @@ infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.the(patterns:
|
||||
* use the function `all(Regex(...), ...)` to create a [All].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -274,7 +264,6 @@ infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.matchFor(patt
|
||||
* @param pattern The patterns which is expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
@JvmName("regexIgnoringCase")
|
||||
infix fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.regex(pattern: String): Expect<T> =
|
||||
@@ -299,7 +288,6 @@ infix fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.regex
|
||||
* -- use the function `regexPatterns(t, ...)` to create a [RegexPatterns].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
@JvmName("regexIgnoringCase")
|
||||
infix fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.the(patterns: RegexPatterns): Expect<T> =
|
||||
@@ -314,7 +302,6 @@ infix fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.the(p
|
||||
* @param pattern The patterns which is expected to have a match against the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.regex(pattern: String): Expect<T> =
|
||||
this atLeast 1 regex pattern
|
||||
@@ -340,7 +327,6 @@ infix fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.regex(patte
|
||||
* use the function `regexPatterns(t, ...)` to create a [RegexPatterns].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.the(patterns: RegexPatterns): Expect<T> =
|
||||
this atLeast 1 the patterns
|
||||
@@ -361,7 +347,6 @@ infix fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.the(pattern
|
||||
* @param expectedIterable The [Iterable] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterable] is not a [CharSequence], [Number] or [Char] or the given
|
||||
* [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
@@ -392,7 +377,6 @@ infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.elementsOf(
|
||||
* @param expectedIterable The [Iterable] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterable] is not a [CharSequence], [Number] or [Char] or the given
|
||||
* [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
@@ -423,7 +407,6 @@ infix fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.eleme
|
||||
* @param expectedIterable The [Iterable] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterable] is not a [CharSequence], [Number] or [Char] or the given
|
||||
* [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
@@ -453,7 +436,6 @@ infix fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.elementsOf(
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
@@ -482,7 +464,6 @@ infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.elementsOf(
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
@@ -511,7 +492,6 @@ infix fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.eleme
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within the input of the search.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
|
||||
* [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
|
||||
@@ -10,7 +10,6 @@ import ch.tutteli.kbox.identity
|
||||
* @param empty Use the pseudo-keyword `empty`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Collection<*>> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") empty: empty): Expect<T> =
|
||||
_logicAppend { isEmpty(::identity) }
|
||||
@@ -21,7 +20,6 @@ infix fun <T : Collection<*>> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") empty
|
||||
* @param empty Use the pseudo-keyword `empty`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Collection<*>> Expect<T>.notToBe(@Suppress("UNUSED_PARAMETER") empty: empty): Expect<T> =
|
||||
_logicAppend { isNotEmpty(::identity) }
|
||||
@@ -32,7 +30,6 @@ infix fun <T : Collection<*>> Expect<T>.notToBe(@Suppress("UNUSED_PARAMETER") em
|
||||
* Shortcut for `size.toBe(expected)`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Collection<*>> Expect<T>.hasSize(expected: Int): Expect<T> =
|
||||
size { toBe(expected) }
|
||||
@@ -53,7 +50,6 @@ val <T : Collection<*>> Expect<T>.size: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Collection<E>> Expect<T>.size(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
_logic.size(::identity).collectAndAppend(assertionCreator)
|
||||
|
||||
@@ -8,7 +8,6 @@ import ch.tutteli.atrium.logic.*
|
||||
* The comparison is carried out with [Comparable.compareTo].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Comparable<T>> Expect<T>.isLessThan(expected: T): Expect<T> =
|
||||
_logicAppend { isLessThan(expected) }
|
||||
@@ -18,7 +17,6 @@ infix fun <T : Comparable<T>> Expect<T>.isLessThan(expected: T): Expect<T> =
|
||||
* The comparison is carried out with [Comparable.compareTo].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Comparable<T>> Expect<T>.isLessThanOrEqual(expected: T): Expect<T> =
|
||||
_logicAppend { isLessThanOrEqual(expected) }
|
||||
@@ -28,7 +26,6 @@ infix fun <T : Comparable<T>> Expect<T>.isLessThanOrEqual(expected: T): Expect<T
|
||||
* The comparison is carried out with [Comparable.compareTo].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Comparable<T>> Expect<T>.isGreaterThan(expected: T): Expect<T> =
|
||||
_logicAppend { isGreaterThan(expected) }
|
||||
@@ -38,7 +35,6 @@ infix fun <T : Comparable<T>> Expect<T>.isGreaterThan(expected: T): Expect<T> =
|
||||
* The comparison is carried out with [Comparable.compareTo].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Comparable<T>> Expect<T>.isGreaterThanOrEqual(expected: T): Expect<T> =
|
||||
_logicAppend { isGreaterThanOrEqual(expected) }
|
||||
@@ -48,7 +44,6 @@ infix fun <T : Comparable<T>> Expect<T>.isGreaterThanOrEqual(expected: T): Expec
|
||||
* where the comparison is carried out with [Comparable.compareTo].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,7 @@ import kotlin.reflect.KProperty1
|
||||
*
|
||||
* @property description The description of the feature.
|
||||
* @property extractor The extractor which extracts the feature out of the subject of the assertion.
|
||||
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
data class Feature<T, R> internal constructor(val description: String, val extractor: (T) -> R)
|
||||
|
||||
@@ -78,7 +78,6 @@ infix fun <T, R> Expect<T>.feature(of: Feature<in T, R>): FeatureExpect<T, R> =
|
||||
* in-between the required arguments in case of a `KFunctionX` where `X` > 1.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case the created [AssertionGroup] does not hold.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,6 @@ import ch.tutteli.atrium.logic.toThrow
|
||||
* the element type is actually `String`.
|
||||
*
|
||||
* @return An [Expect] with the new type [TExpected].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
inline fun <reified TExpected : Throwable> Expect<out () -> Any?>.toThrow(): Expect<TExpected> =
|
||||
_logic.toThrow(TExpected::class).transform()
|
||||
@@ -49,7 +48,6 @@ inline fun <reified TExpected : Throwable> Expect<out () -> Any?>.toThrow(): Exp
|
||||
* the element type is actually `String`.
|
||||
*
|
||||
* @return An [Expect] with the new type [TExpected].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
inline infix fun <reified TExpected : Throwable> Expect<out () -> Any?>.toThrow(
|
||||
noinline assertionCreator: Expect<TExpected>.() -> Unit
|
||||
@@ -61,7 +59,6 @@ inline infix fun <reified TExpected : Throwable> Expect<out () -> Any?>.toThrow(
|
||||
* and changes the subject of the assertion to the return value of type [R].
|
||||
*
|
||||
* @return An [Expect] with the new type [R].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
fun <R, T : () -> R> Expect<T>.notToThrow(): Expect<R> =
|
||||
_logic.notToThrow().transform()
|
||||
@@ -71,7 +68,6 @@ fun <R, T : () -> R> Expect<T>.notToThrow(): Expect<R> =
|
||||
* and that the corresponding return value holds all assertions the given [assertionCreator] creates.
|
||||
*
|
||||
* @return An [Expect] with the new type [R].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <R, T : () -> R> Expect<T>.notToThrow(
|
||||
assertionCreator: Expect<R>.() -> Unit
|
||||
|
||||
@@ -46,7 +46,6 @@ infix fun <E, T : Iterable<E>> Expect<T>.containsNot(
|
||||
* It is a shortcut for `contains o inAny order atLeast 1 value expected`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> Expect<T>.contains(expected: E): Expect<T> =
|
||||
it contains o inAny order atLeast 1 value expected
|
||||
@@ -70,7 +69,6 @@ infix fun <E, T : Iterable<E>> Expect<T>.contains(expected: E): Expect<T> =
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> Expect<T>.contains(values: Values<E>): Expect<T> =
|
||||
it contains o inAny order atLeast 1 the values
|
||||
@@ -87,7 +85,6 @@ infix fun <E, T : Iterable<E>> Expect<T>.contains(values: Values<E>): Expect<T>
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : Iterable<E?>> Expect<T>.contains(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T> =
|
||||
it contains o inAny order atLeast 1 entry assertionCreatorOrNull
|
||||
@@ -105,7 +102,6 @@ infix fun <E : Any, T : Iterable<E?>> Expect<T>.contains(assertionCreatorOrNull:
|
||||
* -- use the function `entries(t, ...)` to create an [Entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : Iterable<E?>> Expect<T>.contains(entries: Entries<E>): Expect<T> =
|
||||
it contains o inAny order atLeast 1 the entries
|
||||
@@ -115,9 +111,8 @@ infix fun <E : Any, T : Iterable<E?>> Expect<T>.contains(entries: Entries<E>): E
|
||||
* the [expected] value.
|
||||
*
|
||||
* It is a shortcut for `contains o inGiven order and only value expected`
|
||||
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> Expect<T>.containsExactly(expected: E): Expect<T> =
|
||||
it contains o inGiven order and only value expected
|
||||
@@ -136,7 +131,6 @@ infix fun <E, T : Iterable<E>> Expect<T>.containsExactly(expected: E): Expect<T>
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> Expect<T>.containsExactly(values: Values<E>): Expect<T> =
|
||||
it contains o inGiven order and only the values
|
||||
@@ -157,7 +151,6 @@ infix fun <E, T : Iterable<E>> Expect<T>.containsExactly(values: Values<E>): Exp
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?
|
||||
@@ -181,7 +174,6 @@ infix fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(
|
||||
* -- use the function `entries(t, ...)` to create an [Entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(entries: Entries<E>): Expect<T> =
|
||||
it contains o inGiven order and only the entries
|
||||
@@ -196,7 +188,6 @@ infix fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(entries: Entries
|
||||
* are passed. This function expects [IterableLike] (which is a typealias for [Any]) to avoid cluttering the API.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
@@ -216,7 +207,6 @@ inline infix fun <reified E, T : Iterable<E>> Expect<T>.containsExactlyElementsO
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
@@ -233,7 +223,6 @@ inline infix fun <reified E, T : Iterable<E>> Expect<T>.containsElementsOf(
|
||||
* It is a shortcut for `containsNot o value expected`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> Expect<T>.containsNot(expected: E): Expect<T> =
|
||||
it containsNot o value expected
|
||||
@@ -248,7 +237,6 @@ infix fun <E, T : Iterable<E>> Expect<T>.containsNot(expected: E): Expect<T> =
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> Expect<T>.containsNot(values: Values<E>): Expect<T> =
|
||||
it containsNot o the values
|
||||
@@ -272,7 +260,6 @@ infix fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.min(@Suppress("UNUSED_P
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -299,7 +286,6 @@ infix fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.max(@Suppress("UNUSED_P
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -315,7 +301,6 @@ infix fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.max(assertionCreator: E
|
||||
* It is a shortcut for `contains o inAny order atLeast 1 entry assertionCreatorOrNull`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : Iterable<E?>> Expect<T>.any(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T> =
|
||||
it contains o inAny order atLeast 1 entry assertionCreatorOrNull
|
||||
@@ -329,7 +314,6 @@ infix fun <E : Any, T : Iterable<E?>> Expect<T>.any(assertionCreatorOrNull: (Exp
|
||||
* It is a shortcut for `containsNot o entry assertionCreatorOrNull`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : Iterable<E?>> Expect<T>.none(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T> =
|
||||
it containsNot o entry assertionCreatorOrNull
|
||||
@@ -340,7 +324,6 @@ infix fun <E : Any, T : Iterable<E?>> Expect<T>.none(assertionCreatorOrNull: (Ex
|
||||
* that all elements are `null` in case [assertionCreatorOrNull] is defined as `null`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : Iterable<E?>> Expect<T>.all(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T> =
|
||||
_logicAppend { all(::identity, assertionCreatorOrNull) }
|
||||
@@ -350,7 +333,6 @@ infix fun <E : Any, T : Iterable<E?>> Expect<T>.all(assertionCreatorOrNull: (Exp
|
||||
* Expects that the subject of the assertion (an [Iterable]) has at least one element.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -361,7 +343,6 @@ infix fun <E, T : Iterable<E>> Expect<T>.has(@Suppress("UNUSED_PARAMETER") next:
|
||||
* Expects that the subject of the assertion (an [Iterable]) does not have next element.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -372,7 +353,6 @@ infix fun <E, T : Iterable<E>> Expect<T>.hasNot(@Suppress("UNUSED_PARAMETER") ne
|
||||
* Expects that the subject of the assertion (an [Iterable]) does not have duplicate elements.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
|
||||
@@ -22,7 +22,6 @@ import ch.tutteli.atrium.domain.creating.typeutils.IterableLike
|
||||
* @param expected The value which is expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> CheckerOption<E, T, InAnyOrderSearchBehaviour>.value(expected: E): Expect<T> =
|
||||
this the values(expected)
|
||||
@@ -45,7 +44,6 @@ infix fun <E, T : Iterable<E>> CheckerOption<E, T, InAnyOrderSearchBehaviour>.va
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> CheckerOption<E, T, InAnyOrderSearchBehaviour>.the(values: Values<E>): Expect<T> =
|
||||
addAssertion(ExpectImpl.iterable.contains.valuesInAnyOrder(this, values.toList()))
|
||||
@@ -62,7 +60,6 @@ infix fun <E, T : Iterable<E>> CheckerOption<E, T, InAnyOrderSearchBehaviour>.th
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : Iterable<E?>> CheckerOption<E?, T, InAnyOrderSearchBehaviour>.entry(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?
|
||||
@@ -79,7 +76,6 @@ infix fun <E : Any, T : Iterable<E?>> CheckerOption<E?, T, InAnyOrderSearchBehav
|
||||
* -- use the function `entries(t, ...)` to create an [Entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : Iterable<E?>> CheckerOption<E?, T, InAnyOrderSearchBehaviour>.the(
|
||||
entries: Entries<E>
|
||||
@@ -95,7 +91,6 @@ infix fun <E : Any, T : Iterable<E?>> CheckerOption<E?, T, InAnyOrderSearchBehav
|
||||
* @param expectedIterable The [Iterable] whose elements are expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case the given [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
* TODO remove with 1.0.0
|
||||
@@ -121,7 +116,6 @@ inline infix fun <reified E, T : Iterable<E>> CheckerOption<E, T, InAnyOrderSear
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
|
||||
@@ -26,7 +26,6 @@ import ch.tutteli.atrium.domain.creating.typeutils.IterableLike
|
||||
* @param expected The value which is expected to be contained within the [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> Builder<E, T, InAnyOrderOnlySearchBehaviour>.value(expected: E): Expect<T> =
|
||||
this the values(expected)
|
||||
@@ -43,7 +42,6 @@ infix fun <E, T : Iterable<E>> Builder<E, T, InAnyOrderOnlySearchBehaviour>.valu
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> Builder<E, T, InAnyOrderOnlySearchBehaviour>.the(values: Values<E>): Expect<T> =
|
||||
addAssertion(ExpectImpl.iterable.contains.valuesInAnyOrderOnly(this, values.toList()))
|
||||
@@ -64,7 +62,6 @@ infix fun <E, T : Iterable<E>> Builder<E, T, InAnyOrderOnlySearchBehaviour>.the(
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : Iterable<E?>> Builder<E?, T, InAnyOrderOnlySearchBehaviour>.entry(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?
|
||||
@@ -94,7 +91,6 @@ infix fun <E : Any, T : Iterable<E?>> Builder<E?, T, InAnyOrderOnlySearchBehavio
|
||||
* -- use the function `entries(t, ...)` to create an [Entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
|
||||
infix fun <E : Any, T : Iterable<E?>> Builder<E?, T, InAnyOrderOnlySearchBehaviour>.the(
|
||||
@@ -115,7 +111,6 @@ infix fun <E : Any, T : Iterable<E?>> Builder<E?, T, InAnyOrderOnlySearchBehavio
|
||||
* @param expectedIterable The [Iterable] whose elements are expected to be contained within this [Iterable]
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case the given [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
* TODO remove with 1.0.0
|
||||
@@ -145,7 +140,6 @@ inline infix fun <reified E, T : Iterable<E>> Builder<E, T, InAnyOrderOnlySearch
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [Iterable]
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
|
||||
@@ -26,7 +26,6 @@ import ch.tutteli.atrium.domain.creating.typeutils.IterableLike
|
||||
* @param expected The value which is expected to be contained within the [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> Builder<E, T, InOrderOnlySearchBehaviour>.value(expected: E): Expect<T> =
|
||||
this the values(expected)
|
||||
@@ -43,7 +42,6 @@ infix fun <E, T : Iterable<E>> Builder<E, T, InOrderOnlySearchBehaviour>.value(e
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> Builder<E, T, InOrderOnlySearchBehaviour>.the(values: Values<E>): Expect<T> =
|
||||
addAssertion(ExpectImpl.iterable.contains.valuesInOrderOnly(this, values.toList()))
|
||||
@@ -64,7 +62,6 @@ infix fun <E, T : Iterable<E>> Builder<E, T, InOrderOnlySearchBehaviour>.the(val
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : Iterable<E?>> Builder<E?, T, InOrderOnlySearchBehaviour>.entry(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?
|
||||
@@ -86,7 +83,6 @@ infix fun <E : Any, T : Iterable<E?>> Builder<E?, T, InOrderOnlySearchBehaviour>
|
||||
* -- use the function `entries(t, ...)` to create an [Entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : Iterable<E?>> Builder<E?, T, InOrderOnlySearchBehaviour>.the(
|
||||
entries: Entries<E>
|
||||
@@ -106,7 +102,6 @@ infix fun <E : Any, T : Iterable<E?>> Builder<E?, T, InOrderOnlySearchBehaviour>
|
||||
* @param expectedIterable The [Iterable] whose elements are expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case the given [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
* @since 0.12.0
|
||||
@@ -136,7 +131,6 @@ inline infix fun <reified E, T : Iterable<E>> Builder<E, T, InOrderOnlySearchBeh
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [Iterable].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
*
|
||||
|
||||
@@ -23,7 +23,6 @@ import kotlin.jvm.JvmName
|
||||
* so a call could look as follows: `inAny order(values(1, 2), value(2), values(3, 2))
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : Iterable<E>> Builder<E, T, InOrderOnlyGroupedWithinSearchBehaviour>.inAny(
|
||||
order: Order<E, Group<E>>
|
||||
@@ -63,7 +62,6 @@ fun <E> order(
|
||||
* ```
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
@JvmName("inAnyOrderEntries")
|
||||
infix fun <E : Any, T : Iterable<E?>> Builder<E?, T, InOrderOnlyGroupedWithinSearchBehaviour>.inAny(
|
||||
|
||||
@@ -22,7 +22,6 @@ import ch.tutteli.atrium.logic.utils.toVarArg
|
||||
* @param expected The value which is expected to be contained within this [IterableLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -48,7 +47,6 @@ infix fun <E, T : IterableLike> CheckerStep<E, T, InAnyOrderSearchBehaviour>.val
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -67,7 +65,6 @@ infix fun <E, T : IterableLike> CheckerStep<E, T, InAnyOrderSearchBehaviour>.the
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -87,7 +84,6 @@ infix fun <E : Any, T : IterableLike> CheckerStep<out E?, T, InAnyOrderSearchBeh
|
||||
* -- use the function `entries(t, ...)` to create an [Entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -109,7 +105,6 @@ infix fun <E : Any, T : IterableLike> CheckerStep<out E?, T, InAnyOrderSearchBeh
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [IterableLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an
|
||||
* [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
|
||||
@@ -27,7 +27,6 @@ import ch.tutteli.atrium.logic.utils.toVarArg
|
||||
* @param expected The value which is expected to be contained within the [IterableLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : IterableLike> EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>.value(expected: E): Expect<T> =
|
||||
this the values(expected)
|
||||
@@ -44,7 +43,6 @@ infix fun <E, T : IterableLike> EntryPointStep<E, T, InAnyOrderOnlySearchBehavio
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : IterableLike> EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>.the(values: Values<E>): Expect<T> =
|
||||
_logicAppend { valuesInAnyOrderOnly(values.toList()) }
|
||||
@@ -65,7 +63,6 @@ infix fun <E, T : IterableLike> EntryPointStep<E, T, InAnyOrderOnlySearchBehavio
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E : Any, T : IterableLike> EntryPointStep<out E?, T, InAnyOrderOnlySearchBehaviour>.entry(
|
||||
assertionCreatorOrNull: (Expect<E>.() -> Unit)?
|
||||
@@ -93,7 +90,6 @@ infix fun <E : Any, T : IterableLike> EntryPointStep<out E?, T, InAnyOrderOnlySe
|
||||
* -- use the function `entries(t, ...)` to create an [Entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
|
||||
infix fun <E : Any, T : IterableLike> EntryPointStep<out E?, T, InAnyOrderOnlySearchBehaviour>.the(
|
||||
@@ -117,7 +113,6 @@ infix fun <E : Any, T : IterableLike> EntryPointStep<out E?, T, InAnyOrderOnlySe
|
||||
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within this [IterableLike]
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not an
|
||||
* [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
|
||||
@@ -26,7 +26,6 @@ import ch.tutteli.atrium.logic.utils.toVarArg
|
||||
* @param expected The value which is expected to be contained within the [IterableLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -45,7 +44,6 @@ infix fun <E, T : IterableLike> EntryPointStep<E, T, InOrderOnlySearchBehaviour>
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -68,7 +66,6 @@ infix fun <E, T : IterableLike> EntryPointStep<E, T, InOrderOnlySearchBehaviour>
|
||||
* or not. In case it is defined as `null`, then an entry is identified if it is `null` as well.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -91,7 +88,6 @@ infix fun <E : Any, T : IterableLike> EntryPointStep<out E?, T, InOrderOnlySearc
|
||||
* -- use the function `entries(t, ...)` to create an [Entries].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -117,7 +113,6 @@ infix fun <E : Any, T : IterableLike> EntryPointStep<out E?, T, InOrderOnlySearc
|
||||
* this [IterableLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedIterableLike] is not
|
||||
* an [Iterable], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedIterableLike] does not have elements (is empty).
|
||||
|
||||
@@ -21,7 +21,6 @@ import kotlin.jvm.JvmName
|
||||
* so a call could look as follows: `inAny order(values(1, 2), value(2), values(3, 2))
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
@@ -48,7 +47,6 @@ infix fun <E, T : IterableLike> EntryPointStep<E, T, InOrderOnlyGroupedWithinSea
|
||||
* ```
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0 -- API existed for [Iterable] but not for [IterableLike].
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,6 @@ import ch.tutteli.atrium.logic.hasNotNext
|
||||
* Expects that the subject of the assertion (an [Iterator]) has at least one element.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
@@ -21,7 +20,6 @@ infix fun <E, T : Iterator<E>> Expect<T>.has(@Suppress("UNUSED_PARAMETER") next:
|
||||
* Expects that the subject of the assertion (an [Iterator]) does not have next element.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,6 @@ import ch.tutteli.atrium.logic.get
|
||||
* returns an [Expect] for the element at that position.
|
||||
*
|
||||
* @return The newly created [Expect] for the element at position [index].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given [index] is out of bound.
|
||||
*/
|
||||
infix fun <E, T : List<E>> Expect<T>.get(index: Int): Expect<E> =
|
||||
_logic.get(index).transform()
|
||||
@@ -23,8 +22,6 @@ infix fun <E, T : List<E>> Expect<T>.get(index: Int): Expect<E> =
|
||||
* Use the function `index(Int) { ... }` to create an [IndexWithCreator].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given [index] is out of bound or
|
||||
* if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <E, T : List<E>> Expect<T>.get(index: IndexWithCreator<E>): Expect<T> =
|
||||
_logic.get(index.index).collectAndAppend(index.assertionCreator)
|
||||
|
||||
@@ -27,7 +27,6 @@ infix fun <K, V, T : Map<out K, V>> Expect<T>.contains(
|
||||
* Delegates to 'it contains o inAny order entry keyValuePair'.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V, T : Map<out K, V>> Expect<T>.contains(keyValuePair: Pair<K, V>): Expect<T> =
|
||||
it contains o inAny order entry keyValuePair
|
||||
@@ -39,7 +38,6 @@ infix fun <K, V, T : Map<out K, V>> Expect<T>.contains(keyValuePair: Pair<K, V>)
|
||||
* Delegates to 'it contains o inAny order but only entry keyValuePair'.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V, T : Map<out K, V>> Expect<T>.containsOnly(keyValuePair: Pair<K, V>): Expect<T> =
|
||||
it contains o inAny order but only entry keyValuePair
|
||||
@@ -58,7 +56,6 @@ infix fun <K, V, T : Map<out K, V>> Expect<T>.containsOnly(keyValuePair: Pair<K,
|
||||
* -- use the function `pairs(x to y, ...)` to create a [Pairs].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V, T : Map<out K, V>> Expect<T>.contains(keyValuePairs: Pairs<K, V>): Expect<T> =
|
||||
it contains o inAny order the keyValuePairs
|
||||
@@ -73,7 +70,6 @@ infix fun <K, V, T : Map<out K, V>> Expect<T>.contains(keyValuePairs: Pairs<K, V
|
||||
* -- use the function `pairs(x to y, ...)` to create a [Pairs].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V, T : Map<out K, V>> Expect<T>.containsOnly(keyValuePairs: Pairs<K, V>): Expect<T> =
|
||||
it contains o inAny order but only the keyValuePairs
|
||||
@@ -92,7 +88,6 @@ infix fun <K, V, T : Map<out K, V>> Expect<T>.containsOnly(keyValuePairs: Pairs<
|
||||
* -- use the function `keyValue(x) { ... }` to create a [KeyWithValueCreator].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
inline infix fun <K, reified V : Any, T : Map<out K, V?>> Expect<T>.contains(keyValue: KeyWithValueCreator<K, V>): Expect<T> =
|
||||
it contains o inAny order entry keyValue
|
||||
@@ -111,7 +106,6 @@ inline infix fun <K, reified V : Any, T : Map<out K, V?>> Expect<T>.contains(key
|
||||
* -- use the function `keyValue(x) { ... }` to create a [KeyWithValueCreator].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
inline infix fun <K, reified V : Any, T : Map<out K, V?>> Expect<T>.containsOnly(keyValue: KeyWithValueCreator<K, V>): Expect<T> =
|
||||
it contains o inAny order but only entry keyValue
|
||||
@@ -136,7 +130,6 @@ fun <K, V : Any> keyValue(key: K, valueAssertionCreatorOrNull: (Expect<V>.() ->
|
||||
* another one is defined as `Key('a') { isLessThan(2) }`, then both match, even though they match the same entry.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
inline infix fun <K, reified V : Any, T : Map<out K, V?>> Expect<T>.contains(
|
||||
allKeyValues: KeyValues<K, V>
|
||||
@@ -152,7 +145,6 @@ inline infix fun <K, reified V : Any, T : Map<out K, V?>> Expect<T>.contains(
|
||||
* Delegates to `it contains o inAny order but only the keyValues`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
inline infix fun <K, reified V : Any, T : Map<out K, V?>> Expect<T>.containsOnly(
|
||||
allKeyValues: KeyValues<K, V>
|
||||
@@ -164,7 +156,6 @@ inline infix fun <K, reified V : Any, T : Map<out K, V?>> Expect<T>.containsOnly
|
||||
* Delegates to `it contains o inAny order entriesOf`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V : Any, T : Map<out K, V?>> Expect<T>.containsEntriesOf(
|
||||
mapLike: MapLike
|
||||
@@ -177,7 +168,6 @@ infix fun <K, V : Any, T : Map<out K, V?>> Expect<T>.containsEntriesOf(
|
||||
* Delegates to `it contains o inAny order but only entriesOf`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V : Any, T : Map<out K, V?>> Expect<T>.containsOnlyEntriesOf(
|
||||
mapLike: MapLike
|
||||
@@ -188,7 +178,6 @@ infix fun <K, V : Any, T : Map<out K, V?>> Expect<T>.containsOnlyEntriesOf(
|
||||
* Expects that the subject of the assertion (a [Map]) contains the given [key].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, T : Map<out K, *>> Expect<T>.containsKey(key: K): Expect<T> =
|
||||
_logicAppend { containsKey(::identity, key) }
|
||||
@@ -197,7 +186,6 @@ infix fun <K, T : Map<out K, *>> Expect<T>.containsKey(key: K): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [Map]) does not contain the given [key].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, T : Map<out K, *>> Expect<T>.containsNotKey(key: K): Expect<T> =
|
||||
_logicAppend { containsNotKey(::identity, key) }
|
||||
@@ -208,7 +196,6 @@ infix fun <K, T : Map<out K, *>> Expect<T>.containsNotKey(key: K): Expect<T> =
|
||||
* so that further fluent calls are assertions about it.
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given [key] does not exist.
|
||||
*/
|
||||
infix fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: K): Expect<V> =
|
||||
_logic.getExisting(::identity, key).transform()
|
||||
@@ -221,8 +208,6 @@ infix fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: K): Expect<V> =
|
||||
* to the key and the second is the `assertionCreator`-lambda
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] the given [key] does not exist or
|
||||
* if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: KeyWithCreator<K, V>): Expect<T> =
|
||||
_logic.getExisting(::identity, key.key).collectAndAppend(key.assertionCreator)
|
||||
@@ -249,7 +234,6 @@ val <K, T : Map<out K, *>> Expect<T>.keys: Expect<Set<K>>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V, T : Map<out K, V>> Expect<T>.keys(assertionCreator: Expect<Set<K>>.() -> Unit): Expect<T> =
|
||||
_logic.property(Map<out K, *>::keys).collectAndAppend(assertionCreator)
|
||||
@@ -269,7 +253,6 @@ val <V, T : Map<*, V>> Expect<T>.values: Expect<Collection<V>>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V, T : Map<out K, V>> Expect<T>.values(assertionCreator: Expect<Collection<V>>.() -> Unit): Expect<T> =
|
||||
_logic.property(Map<out K, V>::values).collectAndAppend(assertionCreator)
|
||||
@@ -306,7 +289,6 @@ infix fun <K, V, T : Map<out K, V>> Expect<T>.asEntries(
|
||||
* @param empty Use the pseudo-keyword `empty`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Map<*, *>> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") empty: empty): Expect<T> =
|
||||
_logicAppend { isEmpty(::toEntries) }
|
||||
@@ -318,7 +300,6 @@ infix fun <T : Map<*, *>> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") empty: em
|
||||
* @param empty Use the pseudo-keyword `empty`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Map<*, *>> Expect<T>.notToBe(@Suppress("UNUSED_PARAMETER") empty: empty): Expect<T> =
|
||||
_logicAppend { isNotEmpty(::toEntries) }
|
||||
|
||||
@@ -21,7 +21,6 @@ val <T : Map<*, *>> Expect<T>.size: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,6 @@ import ch.tutteli.atrium.logic.*
|
||||
* reporting etc.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V, T : Map.Entry<K, V>> Expect<T>.isKeyValue(keyValuePair: Pair<K, V>): Expect<T> =
|
||||
_logicAppend { isKeyValue(keyValuePair.first, keyValuePair.second) }
|
||||
@@ -32,7 +31,6 @@ val <K, T : Map.Entry<K, *>> Expect<T>.key: Expect<K>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V, T : Map.Entry<K, V>> Expect<T>.key(assertionCreator: Expect<K>.() -> Unit): Expect<T> =
|
||||
_logic.key().collectAndAppend(assertionCreator)
|
||||
@@ -52,7 +50,6 @@ val <V, T : Map.Entry<*, V>> Expect<T>.value: Expect<V>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V, T : Map.Entry<K, V>> Expect<T>.value(assertionCreator: Expect<V>.() -> Unit): Expect<T> =
|
||||
_logic.value().collectAndAppend(assertionCreator)
|
||||
|
||||
@@ -20,7 +20,6 @@ import ch.tutteli.atrium.logic.utils.toVarArgPairs
|
||||
* Delegates to `the pairs(keyValuePair)`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -37,7 +36,6 @@ infix fun <K, V, T : MapLike> EntryPointStep<K, V, T, InAnyOrderSearchBehaviour>
|
||||
* even though they match the same entry.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -55,7 +53,6 @@ infix fun <K, V, T : MapLike> EntryPointStep<K, V, T, InAnyOrderSearchBehaviour>
|
||||
* Delegates to `the keyValues(keyValue)`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -77,7 +74,6 @@ inline infix fun <K, reified V : Any, T : MapLike> EntryPointStep<K, out V?, T,
|
||||
* , then both match, even though they match the same entry.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -113,7 +109,6 @@ fun <K, V : Any> keyValues(
|
||||
* @param expectedMapLike The [MapLike] whose elements are expected to be contained within this [MapLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedMapLike] is not
|
||||
* a [Map], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedMapLike] does not have elements (is empty).
|
||||
|
||||
@@ -20,7 +20,6 @@ import ch.tutteli.atrium.logic.utils.toVarArgPairs
|
||||
* Delegates to `the pairs(keyValuePair)`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -34,7 +33,6 @@ infix fun <K, V, T : MapLike> EntryPointStep<K, V, T, InAnyOrderOnlySearchBehavi
|
||||
* in which order they appear.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -52,7 +50,6 @@ infix fun <K, V, T : MapLike> EntryPointStep<K, V, T, InAnyOrderOnlySearchBehavi
|
||||
* Delegates to `the keyValues(keyValue)`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -70,7 +67,6 @@ inline infix fun <K, reified V : Any, T : MapLike> EntryPointStep<K, out V?, T,
|
||||
* [KeyWithValueCreator.valueAssertionCreatorOrNull] is defined as `null`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -95,7 +91,6 @@ inline infix fun <K, reified V : Any, T : MapLike> EntryPointStep<K, out V?, T,
|
||||
* @param expectedMapLike The [MapLike] whose elements are expected to be contained within this [MapLike].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedMapLike] is not
|
||||
* a [Map], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedMapLike] does not have elements (is empty).
|
||||
|
||||
@@ -23,7 +23,6 @@ import ch.tutteli.atrium.logic.utils.toVarArgPairs
|
||||
* Delegates to `the pairs(keyValuePair)`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -36,7 +35,6 @@ infix fun <K, V, T : MapLike> EntryPointStep<K, V, T, InOrderOnlySearchBehaviour
|
||||
* needs to contain only the given [keyValuePairs] in the specified order.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -55,7 +53,6 @@ infix fun <K, V, T : MapLike> EntryPointStep<K, V, T, InOrderOnlySearchBehaviour
|
||||
* Delegates to `the keyValues(keyValue)`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -73,7 +70,6 @@ inline infix fun <K, reified V : Any, T : MapLike> EntryPointStep<K, out V?, T,
|
||||
* [KeyWithValueCreator.valueAssertionCreatorOrNull] is defined as `null`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.15.0
|
||||
*/
|
||||
@@ -96,7 +92,6 @@ inline infix fun <K, reified V : Any, T : MapLike> EntryPointStep<K, out V?, T,
|
||||
* This function expects [MapLike] (which is a typealias for [Any]) to avoid cluttering the API.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @throws IllegalArgumentException in case [expectedMapLike] is not
|
||||
* a [Map], [Sequence] or one of the [Array] types
|
||||
* or the given [expectedMapLike] does not have elements (is empty).
|
||||
|
||||
@@ -20,7 +20,6 @@ val <K, T : Pair<K, *>> Expect<T>.first: Expect<K>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V, T : Pair<K, V>> Expect<T>.first(assertionCreator: Expect<K>.() -> Unit): Expect<T> =
|
||||
_logic.first().collectAndAppend(assertionCreator)
|
||||
@@ -40,7 +39,6 @@ val <V, T : Pair<*, V>> Expect<T>.second: Expect<V>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <K, V, T : Pair<K, V>> Expect<T>.second(assertionCreator: Expect<V>.() -> Unit): Expect<T> =
|
||||
_logic.second().collectAndAppend(assertionCreator)
|
||||
|
||||
@@ -11,7 +11,6 @@ import ch.tutteli.atrium.logic.causeIsA
|
||||
* creates an [Expect] for it and returns it.
|
||||
*
|
||||
* @return The newly created [Expect] for the property [Throwable.message] of the subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
val <T : Throwable> Expect<T>.message: Expect<String>
|
||||
get() = it feature Throwable::message notToBeNull o
|
||||
@@ -22,7 +21,6 @@ val <T : Throwable> Expect<T>.message: Expect<String>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Throwable> Expect<T>.message(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
|
||||
it feature of(Throwable::message) { it notToBeNull assertionCreator }
|
||||
@@ -36,7 +34,6 @@ infix fun <T : Throwable> Expect<T>.message(assertionCreator: Expect<String>.()
|
||||
* so that you can mix [String] and [Int] for instance.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Throwable> Expect<T>.messageContains(expected: CharSequenceOrNumberOrChar): Expect<T> =
|
||||
this messageContains values(expected)
|
||||
@@ -52,7 +49,6 @@ infix fun <T : Throwable> Expect<T>.messageContains(expected: CharSequenceOrNumb
|
||||
* -- use the function `values(t, ...)` to create a [Values].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*/
|
||||
infix fun <T : Throwable> Expect<T>.messageContains(values: Values<Any>): Expect<T> =
|
||||
message { contains(values) }
|
||||
@@ -62,7 +58,6 @@ infix fun <T : Throwable> Expect<T>.messageContains(values: Values<Any>): Expect
|
||||
* creates an [Expect] of the [TExpected] type for it and returns it.
|
||||
*
|
||||
* @return The newly created [Expect] for the property [Throwable.cause] of the subject of the assertion
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -78,7 +73,6 @@ inline fun <reified TExpected : Throwable> Expect<out Throwable>.cause(): Expect
|
||||
* [Expect] of the initial type, which was some type `T `, but an [Expect] of the specified type [TExpected].
|
||||
*
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
|
||||
@@ -49,8 +49,7 @@ infix fun <T : BigDecimal?> Expect<T>.toBe(expected: T): Nothing = throw PleaseU
|
||||
* Expects that the subject of the assertion (a [BigDecimal]) is `null`.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
|
||||
*/
|
||||
@JvmName("toBeNull")
|
||||
infix fun <T : BigDecimal> Expect<T?>.toBe(expected: Nothing?): Expect<T?> =
|
||||
@@ -91,8 +90,7 @@ infix fun <T : BigDecimal> Expect<T>.notToBe(expected: T): Nothing = throw Pleas
|
||||
* - `expect(BigDecimal("10")).isNumericallyEqualTo(BigDecimal("10.0"))` holds.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
|
||||
*/
|
||||
infix fun <T : BigDecimal> Expect<T>.isNumericallyEqualTo(expected: T): Expect<T> =
|
||||
_logicAppend { isNumericallyEqualTo(expected) }
|
||||
@@ -110,8 +108,7 @@ infix fun <T : BigDecimal> Expect<T>.isNumericallyEqualTo(expected: T): Expect<T
|
||||
* - `expect(BigDecimal("10")).isNotNumericallyEqualTo(BigDecimal("10.0"))` does not hold.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
|
||||
*/
|
||||
infix fun <T : BigDecimal> Expect<T>.isNotNumericallyEqualTo(expected: T): Expect<T> =
|
||||
_logicAppend { isNotNumericallyEqualTo(expected) }
|
||||
@@ -127,8 +124,7 @@ infix fun <T : BigDecimal> Expect<T>.isNotNumericallyEqualTo(expected: T): Expec
|
||||
* - `expect(BigDecimal("10")).isNumericallyEqualTo(BigDecimal("10.0"))` holds.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
|
||||
*/
|
||||
infix fun <T : BigDecimal> Expect<T>.isEqualIncludingScale(expected: T): Expect<T> =
|
||||
_logicAppend { isEqualIncludingScale(expected, this::isNumericallyEqualTo.name) }
|
||||
@@ -143,8 +139,7 @@ infix fun <T : BigDecimal> Expect<T>.isEqualIncludingScale(expected: T): Expect<
|
||||
* - `expect(BigDecimal("10")).isNotNumericallyEqualTo(BigDecimal("10.0"))` does not hold.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
|
||||
*/
|
||||
infix fun <T : BigDecimal> Expect<T>.isNotEqualIncludingScale(expected: T): Expect<T> =
|
||||
_logicAppend { isNotEqualIncludingScale(expected) }
|
||||
|
||||
@@ -14,7 +14,6 @@ import java.time.chrono.ChronoLocalDate
|
||||
* is before the [expected] [ChronoLocalDate].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -26,7 +25,6 @@ infix fun <T : ChronoLocalDate> Expect<T>.isBefore(expected: ChronoLocalDate): E
|
||||
* is before or equal the [expected] [ChronoLocalDate].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -38,7 +36,6 @@ infix fun <T : ChronoLocalDate> Expect<T>.isBeforeOrEqual(expected: ChronoLocalD
|
||||
* is after the [expected] [ChronoLocalDate].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -50,7 +47,6 @@ infix fun <T : ChronoLocalDate> Expect<T>.isAfter(expected: ChronoLocalDate): Ex
|
||||
* is after or equal the [expected] [ChronoLocalDate].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -62,7 +58,6 @@ infix fun <T : ChronoLocalDate> Expect<T>.isAfterOrEqual(expected: ChronoLocalDa
|
||||
* is equal to the [expected] [ChronoLocalDate].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -75,7 +70,6 @@ infix fun <T : ChronoLocalDate> Expect<T>.isEqual(expected: ChronoLocalDate): Ex
|
||||
* The [expected] parameter needs to be in the form of **yyyy-mm-dd** or else a [java.time.DateTimeException] will be thrown.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -88,7 +82,6 @@ infix fun <T : ChronoLocalDate> Expect<T>.isBefore(expected: String): Expect<T>
|
||||
* The [expected] parameter needs to be in the form of **yyyy-mm-dd** or else a [java.time.DateTimeException] will be thrown.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -101,7 +94,6 @@ infix fun <T : ChronoLocalDate> Expect<T>.isBeforeOrEqual(expected: String): Exp
|
||||
* The [expected] parameter needs to be in the form of **yyyy-mm-dd** or else a [java.time.DateTimeException] will be thrown.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -114,7 +106,6 @@ infix fun <T : ChronoLocalDate> Expect<T>.isAfter(expected: String): Expect<T> =
|
||||
* The [expected] parameter needs to be in the form of **yyyy-mm-dd** or else a [java.time.DateTimeException] will be thrown.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -127,7 +118,6 @@ infix fun <T : ChronoLocalDate> Expect<T>.isAfterOrEqual(expected: String): Expe
|
||||
* The [expected] parameter needs to be in the form of **yyyy-mm-dd** or else a [java.time.DateTimeException] will be thrown.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.time.chrono.ChronoLocalDateTime
|
||||
* is before the [expected] [ChronoLocalDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -29,7 +28,6 @@ infix fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBefore(
|
||||
* is before or equal the [expected] [ChronoLocalDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -42,7 +40,6 @@ infix fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqu
|
||||
* is after the [expected] [ChronoLocalDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -55,7 +52,6 @@ infix fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
* is after or equal the [expected] [ChronoLocalDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -68,7 +64,6 @@ infix fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqua
|
||||
* is equal to the [expected] [ChronoLocalDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -88,7 +83,6 @@ infix fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isEqual(
|
||||
* yyyy-mm-dd
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
@@ -108,7 +102,6 @@ infix fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBefore(
|
||||
* yyyy-mm-dd
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
@@ -128,7 +121,6 @@ infix fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqu
|
||||
* yyyy-mm-dd
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
@@ -148,7 +140,6 @@ infix fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
* yyyy-mm-dd
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
@@ -168,7 +159,6 @@ infix fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqua
|
||||
* yyyy-mm-dd
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,6 @@ import java.time.chrono.ChronoZonedDateTime
|
||||
* is before the [expected] [ChronoZonedDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -28,7 +27,6 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBefore(
|
||||
* is before or equals the [expected] [ChronoZonedDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -41,7 +39,6 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqu
|
||||
* is after the [expected] [ChronoZonedDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -54,7 +51,6 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
* is after or equal the [expected] [ChronoZonedDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -67,7 +63,6 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqua
|
||||
* is equal to the [expected] [ChronoZonedDateTime].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -101,7 +96,6 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isEqual(
|
||||
* - 2020-01-02+01:30
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -135,7 +129,6 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBefore(
|
||||
* - 2020-01-02+01:30
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -169,7 +162,6 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqu
|
||||
* - 2020-01-02+01:30
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -203,7 +195,6 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
* - 2020-01-02+01:30
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -237,7 +228,6 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqua
|
||||
* - 2020-01-02+01:30
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,6 @@ val Expect<LocalDate>.year: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -51,7 +50,6 @@ val Expect<LocalDate>.month: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -75,7 +73,6 @@ val Expect<LocalDate>.dayOfWeek: Expect<DayOfWeek>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -100,7 +97,6 @@ val Expect<LocalDate>.day: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,6 @@ val Expect<LocalDateTime>.year: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -51,7 +50,6 @@ val Expect<LocalDateTime>.month: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -75,7 +73,6 @@ val Expect<LocalDateTime>.dayOfWeek: Expect<DayOfWeek>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -99,7 +96,6 @@ val Expect<LocalDateTime>.day: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.*
|
||||
* depends on the underlying implementation though.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -36,7 +35,6 @@ infix fun <T : Optional<*>> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") empty:
|
||||
* depends on the underlying implementation though.
|
||||
*
|
||||
* @return The newly created [Expect] for the inner type [E].
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given assertion is not a success.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -48,7 +46,6 @@ infix fun <E, T : Optional<E>> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") pres
|
||||
* that it holds all assertions the given [PresentWithCreator.assertionCreator] creates.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given assertions are not success.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,6 @@ import java.nio.file.Path
|
||||
* Expects that the subject of the assertion (a [Path]) starts with the [expected] [Path].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -29,7 +28,6 @@ infix fun <T : Path> Expect<T>.startsWith(expected: Path): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [Path]) does not start with the [expected] [Path].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -40,7 +38,6 @@ infix fun <T : Path> Expect<T>.startsNotWith(expected: Path): Expect<T> =
|
||||
* Expects that the subject of the assertion (a [Path]) ends with the expected [Path].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -52,7 +49,6 @@ infix fun <T : Path> Expect<T>.endsWith(expected: Path): Expect<T> =
|
||||
*
|
||||
* @param expected The [Path] provided to the assertion
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -67,7 +63,6 @@ infix fun <T : Path> Expect<T>.endsNotWith(expected: Path): Expect<T> =
|
||||
* then the search will continue at that location.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -82,7 +77,6 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") existing: exis
|
||||
* then the search will continue at that location.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -108,7 +102,6 @@ val <T : Path> Expect<T>.fileName: Expect<String>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -121,7 +114,6 @@ infix fun <T : Path> Expect<T>.fileName(assertionCreator: Expect<String>.() -> U
|
||||
* so that further fluent calls are assertions about it.
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -135,7 +127,6 @@ val <T : Path> Expect<T>.fileNameWithoutExtension: Expect<String>
|
||||
* and returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -147,7 +138,6 @@ infix fun <T : Path> Expect<T>.fileNameWithoutExtension(assertionCreator: Expect
|
||||
* so that further fluent calls are assertions about it.
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -159,7 +149,6 @@ val <T : Path> Expect<T>.parent: Expect<Path>
|
||||
* given [assertionCreator] creates for it and returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -171,7 +160,6 @@ infix fun <T : Path> Expect<T>.parent(assertionCreator: Expect<Path>.() -> Unit)
|
||||
* so that further fluent calls are assertions about it.
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -193,7 +181,6 @@ infix fun <T : Path> Expect<T>.resolve(other: String): Expect<Path> =
|
||||
* take place.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @see [has]
|
||||
*
|
||||
* @since 0.14.0
|
||||
@@ -216,7 +203,6 @@ infix fun <T : Path> Expect<T>.hasDirectoryEntry(entry: String) =
|
||||
* take place.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
* @see [directoryEntries]
|
||||
* @see [hasDirectoryEntry]
|
||||
*
|
||||
@@ -240,7 +226,6 @@ fun directoryEntries(entry: String, vararg otherEntries: String) = DirectoryEntr
|
||||
* Use the function `path(String) { ... }` to create a [PathWithCreator].
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -267,7 +252,6 @@ fun <E> path(path: String, assertionCreator: Expect<E>.() -> Unit): PathWithCrea
|
||||
* take place.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -284,7 +268,6 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") readable: read
|
||||
* at the location the link points at.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -305,7 +288,6 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") writable: writ
|
||||
* at the location the link points at.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -325,7 +307,6 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") executable: ex
|
||||
* take place.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -345,7 +326,6 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aRegularFile:
|
||||
* take place.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -357,7 +337,6 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aDirectory: aD
|
||||
* meaning that the [Path] specified in this instance starts at the file system root.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -369,7 +348,6 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") absolute: abso
|
||||
* meaning that the [Path] specified in this instance does not start at the file system root.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.14.0
|
||||
*/
|
||||
@@ -396,7 +374,6 @@ val <T : Path> Expect<T>.extension: Expect<String>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -408,7 +385,6 @@ infix fun <T : Path> Expect<T>.extension(assertionCreator: Expect<String>.() ->
|
||||
* as [targetPath] (using UTF-8 for encoding)
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
@@ -438,7 +414,6 @@ fun withEncoding(
|
||||
* Use the function `withEncoding(Path, Charset, Charset)` to create a [PathWithEncoding].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
@@ -452,7 +427,6 @@ infix fun <T : Path> Expect<T>.hasSameTextualContentAs(pathWithEncoding: PathWit
|
||||
* as [targetPath].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,6 @@ val Expect<ZonedDateTime>.year: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -51,7 +50,6 @@ val Expect<ZonedDateTime>.month: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -75,7 +73,6 @@ val Expect<ZonedDateTime>.dayOfWeek: Expect<DayOfWeek>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -99,7 +96,6 @@ val Expect<ZonedDateTime>.day: Expect<Int>
|
||||
* returns an [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,6 @@ import ch.tutteli.atrium.logic.kotlin_1_3.isSuccess
|
||||
* and returns an [Expect] for the inner type [E].
|
||||
*
|
||||
* @return The newly created [Expect] if the given assertion is success
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given assertion is not a success.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -26,7 +25,6 @@ infix fun <E, T : Result<E>> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") succes
|
||||
* Use the function `success { ... }` to create a [SuccessWithCreator].
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the given assertions are not success.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -38,7 +36,6 @@ infix fun <E, T : Result<E>> Expect<T>.toBe(success: SuccessWithCreator<E>): Exp
|
||||
* that it encapsulates an exception of type [TExpected].
|
||||
*
|
||||
* @return An [Expect] with the new type [TExpected]
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@@ -51,7 +48,6 @@ inline fun <reified TExpected : Throwable> Expect<out Result<*>>.isFailure(): Ex
|
||||
* holds all assertions the given [assertionCreator] creates.
|
||||
*
|
||||
* @return An [Expect] with the new type [TExpected]
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,6 @@ interface Expect<T> : SubjectProvider<T> {
|
||||
* @param assertionCreator The receiver function which should create and add assertions to this container.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] depending on the concrete implementation.
|
||||
*/
|
||||
fun addAssertionsCreatedBy(assertionCreator: Expect<T>.() -> Unit): Expect<T>
|
||||
|
||||
@@ -56,9 +55,6 @@ interface Expect<T> : SubjectProvider<T> {
|
||||
* @param assertion The assertion which will be added to this container.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @throws AssertionError Might throw an [AssertionError] in case [Assertion]s are immediately
|
||||
* evaluated (see [ReportingAssertionContainer]).
|
||||
*/
|
||||
override fun addAssertion(assertion: Assertion): Expect<T>
|
||||
|
||||
@@ -72,8 +68,6 @@ interface Expect<T> : SubjectProvider<T> {
|
||||
* @param test Indicates whether the assertion holds or fails.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case [Assertion]s are immediately
|
||||
* evaluated (see [ReportingAssertionContainer]).
|
||||
*/
|
||||
fun createAndAddAssertion(description: String, expected: Any?, test: (T) -> Boolean): Expect<T> =
|
||||
createAndAddAssertion(Untranslatable(description), expected, test)
|
||||
@@ -87,10 +81,7 @@ interface Expect<T> : SubjectProvider<T> {
|
||||
* @param test Indicates whether the assertion holds or fails.
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case [Assertion]s are immediately
|
||||
* evaluated (see [ReportingAssertionContainer]).
|
||||
*/
|
||||
fun createAndAddAssertion(description: Translatable, expected: Any?, test: (T) -> Boolean): Expect<T> =
|
||||
addAssertion(assertionBuilder.createDescriptive(this, description, expected, test))
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user