Skip to content

Commit

Permalink
Merge pull request #868 from robstoll/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
robstoll authored Apr 13, 2021
2 parents ef847c5 + f7d2b1d commit c0a3faf
Show file tree
Hide file tree
Showing 35 changed files with 208 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import kotlin.reflect.KClass
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.deprecated.AnyAssertionSamples.toBe
*/
@Deprecated("Use toEqual; will be removed latest with 1.0.0", ReplaceWith("this.toEqual<T>(expected)"))
@Deprecated("Use toEqual; will be removed with 1.0.0 at the latest", ReplaceWith("this.toEqual<T>(expected)"))
fun <T> Expect<T>.toBe(expected: T): Expect<T> = _logicAppend { toBe(expected) }

/**
Expand All @@ -27,7 +27,7 @@ fun <T> Expect<T>.toBe(expected: T): Expect<T> = _logicAppend { toBe(expected) }
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.deprecated.AnyAssertionSamples.notToBe
*/
@Deprecated("Use notToEqual; will be removed latest with 1.0.0", ReplaceWith("this.notToEqual<T>(expected)"))
@Deprecated("Use notToEqual; will be removed with 1.0.0 at the latest", ReplaceWith("this.notToEqual<T>(expected)"))
fun <T> Expect<T>.notToBe(expected: T): Expect<T> = _logicAppend { notToBe(expected) }

/**
Expand All @@ -37,7 +37,7 @@ fun <T> Expect<T>.notToBe(expected: T): Expect<T> = _logicAppend { notToBe(expec
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.deprecated.AnyAssertionSamples.isSameAs
*/
@Deprecated("Use toBeTheInstance; will be removed latest with 1.0.0", ReplaceWith("this.toBeTheInstance<T>(expected)"))
@Deprecated("Use toBeTheInstance; will be removed with 1.0.0 at the latest", ReplaceWith("this.toBeTheInstance<T>(expected)"))
fun <T> Expect<T>.isSameAs(expected: T): Expect<T> = _logicAppend { isSameAs(expected) }

/**
Expand All @@ -48,7 +48,7 @@ fun <T> Expect<T>.isSameAs(expected: T): Expect<T> = _logicAppend { isSameAs(exp
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.deprecated.AnyAssertionSamples.isNotSameAs
*/
@Deprecated(
"Use notToBeTheInstance; will be removed latest with 1.0.0",
"Use notToBeTheInstance; will be removed with 1.0.0 at the latest",
ReplaceWith("this.notToBeTheInstance<T>(expected)")
)
fun <T> Expect<T>.isNotSameAs(expected: T): Expect<T> = _logicAppend { isNotSameAs(expected) }
Expand All @@ -62,9 +62,9 @@ fun <T> Expect<T>.isNotSameAs(expected: T): Expect<T> = _logicAppend { isNotSame
*
* @return an [Expect] for the subject of `this` expectation.
*
* @since 0.15.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationSamples.because
*
* @since 0.15.0
*/
fun <T> Expect<T>.because(reason: String, assertionCreator: Expect<T>.() -> Unit): Expect<T> =
_logicAppend { because(reason, assertionCreator) }
Expand All @@ -79,7 +79,7 @@ fun <T> Expect<T>.because(reason: String, assertionCreator: Expect<T>.() -> Unit
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.deprecated.AnyAssertionSamples.toBeNullIfNullGivenElse
*/
@Deprecated(
"Use toEqualNullIfNullGivenElse; will be removed latest with 1.0.0",
"Use toEqualNullIfNullGivenElse; will be removed with 1.0.0 at the latest",
ReplaceWith("this.toEqualNullIfNullGivenElse<T>(assertionCreatorOrNull)")
)
fun <T : Any> Expect<T?>.toBeNullIfNullGivenElse(
Expand All @@ -93,7 +93,7 @@ fun <T : Any> Expect<T?>.toBeNullIfNullGivenElse(
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.deprecated.AnyAssertionSamples.notToBeNullFeature
*/
@Deprecated("Use notToEqualNull; will be removed latest with 1.0.0", ReplaceWith("this.notToEqualNull<T>()"))
@Deprecated("Use notToEqualNull; will be removed with 1.0.0 at the latest", ReplaceWith("this.notToEqualNull<T>()"))
inline fun <reified T : Any> Expect<T?>.notToBeNull(): Expect<T> = notToBeNullButOfType(T::class).transform()

@PublishedApi // in order that _logic does not become part of the API we have this extra function
Expand All @@ -109,7 +109,7 @@ internal fun <T : Any> Expect<T?>.notToBeNullButOfType(kClass: KClass<T>): Subje
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.deprecated.AnyAssertionSamples.notToBeNull
*/
@Deprecated(
"Use notToEqualNull; will be removed latest with 1.0.0",
"Use notToEqualNull; will be removed with 1.0.0 at the latest",
ReplaceWith("this.notToEqualNull<T>(assertionCreator)")
)
inline fun <reified T : Any> Expect<T?>.notToBeNull(noinline assertionCreator: Expect<T>.() -> Unit): Expect<T> =
Expand All @@ -135,7 +135,7 @@ inline fun <reified T : Any> Expect<T?>.notToBeNull(noinline assertionCreator: E
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.deprecated.AnyAssertionSamples.isAFeature
*/
@Deprecated("Use toBeAnInstanceOf; will be removed latest with 1.0.0", ReplaceWith("this.toBeAnInstanceOf<TSub>()"))
@Deprecated("Use toBeAnInstanceOf; will be removed with 1.0.0 at the latest", ReplaceWith("this.toBeAnInstanceOf<TSub>()"))
inline fun <reified TSub : Any> Expect<*>.isA(): Expect<TSub> = isA(TSub::class).transform()

@PublishedApi // in order that _logic does not become part of the API we have this extra function
Expand Down Expand Up @@ -184,7 +184,7 @@ internal fun <TSub : Any> Expect<*>.isA(kClass: KClass<TSub>): SubjectChangerBui
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.deprecated.AnyAssertionSamples.isA
*/
@Deprecated("Use toBeAnInstanceOf; will be removed latest with 1.0.0", ReplaceWith("this.toBeAnInstanceOf<TSub>(assertionCreator)"))
@Deprecated("Use toBeAnInstanceOf; will be removed with 1.0.0 at the latest", ReplaceWith("this.toBeAnInstanceOf<TSub>(assertionCreator)"))
inline fun <reified TSub : Any> Expect<*>.isA(noinline assertionCreator: Expect<TSub>.() -> Unit): Expect<TSub> =
isA(TSub::class).transformAndAppend(assertionCreator)

Expand Down Expand Up @@ -223,12 +223,12 @@ infix fun <T> Expect<T>.and(assertionCreator: Expect<T>.() -> Unit): Expect<T> =
*
* @return an [Expect] for the subject of `this` expectation.
*
* @since 0.13.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.deprecated.AnyAssertionSamples.isNoneOf
*
* @since 0.13.0
*/
@Deprecated(
"Use notToEqualOneOf; will be removed latest with 1.0.0",
"Use notToEqualOneOf; will be removed with 1.0.0 at the latest",
ReplaceWith("this.notToEqualOneOf<T>(expected, *otherValues)")
)
fun <T> Expect<T>.isNoneOf(expected: T, vararg otherValues: T): Expect<T> =
Expand All @@ -243,11 +243,11 @@ fun <T> Expect<T>.isNoneOf(expected: T, vararg otherValues: T): Expect<T> =
* @return an [Expect] for the subject of `this` expectation.
* @throws IllegalArgumentException in case the iterable is empty.
*
* @since 0.13.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.deprecated.AnyAssertionSamples.isNotIn
*
* @since 0.13.0
*/
@Deprecated("Use notToBeIn; will be removed latest with 1.0.0", ReplaceWith("this.notToBeIn<T>(expected)"))
@Deprecated("Use notToBeIn; will be removed with 1.0.0 at the latest", ReplaceWith("this.notToBeIn<T>(expected)"))
fun <T> Expect<T>.isNotIn(expected: IterableLike): Expect<T> =
_logicAppend { isNotIn(iterableLikeToIterable(expected)) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import kotlin.reflect.KClass
*
* @return an [Expect] for the subject of `this` expectation.
*
* @since 0.17.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationSamples.toEqual
*
* @since 0.17.0
*/
fun <T> Expect<T>.toEqual(expected: T): Expect<T> = _logicAppend { toBe(expected) }

Expand All @@ -24,9 +24,9 @@ fun <T> Expect<T>.toEqual(expected: T): Expect<T> = _logicAppend { toBe(expected
*
* @return an [Expect] for the subject of `this` expectation.
*
* @since 0.17.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationSamples.notToEqual
*
* @since 0.17.0
*/
fun <T> Expect<T>.notToEqual(expected: T): Expect<T> = _logicAppend { notToBe(expected) }

Expand All @@ -35,9 +35,9 @@ fun <T> Expect<T>.notToEqual(expected: T): Expect<T> = _logicAppend { notToBe(ex
*
* @return an [Expect] for the subject of `this` expectation.
*
* @since 0.17.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationSamples.toBeTheInstance
*
* @since 0.17.0
*/
fun <T> Expect<T>.toBeTheInstance(expected: T): Expect<T> = _logicAppend { isSameAs(expected) }

Expand All @@ -46,9 +46,9 @@ fun <T> Expect<T>.toBeTheInstance(expected: T): Expect<T> = _logicAppend { isSam
*
* @return an [Expect] for the subject of `this` expectation.
*
* @since 0.17.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationSamples.notToBeTheInstance
*
* @since 0.17.0
*/
fun <T> Expect<T>.notToBeTheInstance(expected: T): Expect<T> = _logicAppend { isNotSameAs(expected) }

Expand Down Expand Up @@ -106,9 +106,9 @@ inline fun <reified T : Any> Expect<T?>.notToEqualNull(noinline assertionCreator
*
* @return An [Expect] with the new type [TSub].
*
* @since 0.17.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationSamples.toBeAnInstanceOfFeature
*
* @since 0.17.0
*/
inline fun <reified TSub : Any> Expect<*>.toBeAnInstanceOf(): Expect<TSub> = toBeAnInstanceOf(TSub::class).transform()

Expand Down Expand Up @@ -156,9 +156,9 @@ internal fun <TSub : Any> Expect<*>.toBeAnInstanceOf(kClass: KClass<TSub>): Subj
*
* @return An [Expect] with the new type [TSub].
*
* @since 0.17.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationSamples.toBeAnInstanceOf
*
* @since 0.17.0
*/
inline fun <reified TSub : Any> Expect<*>.toBeAnInstanceOf(noinline assertionCreator: Expect<TSub>.() -> Unit): Expect<TSub> =
toBeAnInstanceOf(TSub::class).transformAndAppend(assertionCreator)
Expand All @@ -169,9 +169,9 @@ inline fun <reified TSub : Any> Expect<*>.toBeAnInstanceOf(noinline assertionCre
*
* @return an [Expect] for the subject of `this` expectation.
*
* @since 0.17.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationSamples.notToEqualOneOf
*
* @since 0.17.0
*/
fun <T> Expect<T>.notToEqualOneOf(expected: T, vararg otherValues: T): Expect<T> =
_logicAppend { isNotIn(expected glue otherValues) }
Expand All @@ -185,9 +185,9 @@ fun <T> Expect<T>.notToEqualOneOf(expected: T, vararg otherValues: T): Expect<T>
* @return an [Expect] for the subject of `this` expectation.
* @throws IllegalArgumentException in case the iterable is empty.
*
* @since 0.17.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationSamples.notToEqualOneIn
*
* @since 0.17.0
*/
fun <T> Expect<T>.notToEqualOneIn(expected: IterableLike): Expect<T> =
_logicAppend { isNotIn(iterableLikeToIterable(expected)) }
Expand Down
Loading

0 comments on commit c0a3faf

Please sign in to comment.