Skip to content

Commit 82dfd5b

Browse files
committed
remove error-level deprecations
1 parent 1034194 commit 82dfd5b

File tree

4 files changed

+0
-108
lines changed

4 files changed

+0
-108
lines changed

assertk/src/commonMain/kotlin/assertk/assert.kt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
package assertk
22

3-
import assertk.assertions.isFailure
4-
import assertk.assertions.isSuccess
53
import assertk.assertions.support.display
64
import assertk.assertions.support.show
7-
import kotlin.DeprecationLevel.ERROR
85
import kotlin.reflect.KProperty0
9-
import kotlin.runCatching
106

117
/**
128
* Marks the assertion DSL.
@@ -175,22 +171,6 @@ fun <T> Assert<T>.all(body: Assert<T>.() -> Unit) {
175171
}
176172
}
177173

178-
/**
179-
* Asserts on the given block returning an `Assert<Result<T>>`. You can test that it returns a value or throws an exception.
180-
*
181-
* ```
182-
* assertThat { 1 + 1 }.isSuccess().isPositive()
183-
*
184-
* assertThat {
185-
* throw Exception("error")
186-
* }.isFailure().hasMessage("error")
187-
* ```
188-
*
189-
* @see assertFailure
190-
*/
191-
@Deprecated("Use assertThat(result) or assertFailure", ReplaceWith("assertThat(runCatching(f))"), ERROR)
192-
inline fun <T> assertThat(f: () -> T): Assert<Result<T>> = assertThat(runCatching(f))
193-
194174
/**
195175
* Runs all assertions in the given lambda and reports any failures.
196176
*/

assertk/src/commonMain/kotlin/assertk/failure.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,6 @@ fun fail(error: AssertionError): Nothing {
157157

158158
internal val NONE: Any = Any()
159159

160-
// TODO Delete this before 1.0.
161-
@Deprecated("For binary compatibility", level = HIDDEN)
162-
fun fail(message: String, expected: Any? = NONE, actual: Any? = NONE): Nothing {
163-
fail(message, expected, actual, null)
164-
}
165-
166160
/**
167161
* Fail the test with the given message.
168162
*/

assertk/src/commonTest/kotlin/test/assertk/AssertLambdaTest.kt

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

assertk/src/jvmMain/kotlin/assertk/assertions/any.kt

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import assertk.all
77
import assertk.assertions.support.appendName
88
import assertk.assertions.support.expected
99
import assertk.assertions.support.show
10-
import java.lang.reflect.InvocationTargetException
11-
import kotlin.reflect.KCallable
1210
import kotlin.reflect.KClass
1311
import kotlin.reflect.KProperty1
1412
import kotlin.reflect.full.IllegalCallableAccessException
@@ -68,32 +66,6 @@ fun <T : Any> Assert<T>.isNotInstanceOf(jclass: Class<out T>) = given { actual -
6866
expected("to not be instance of:${show(jclass)}")
6967
}
7068

71-
/**
72-
* Returns an assert that asserts on the given property.
73-
* @param callable The function to get the property value out of the value of the current assert. The name of this
74-
* callable will be shown in failure messages.
75-
*
76-
* ```
77-
* assertThat(person).prop(Person::name).isEqualTo("Sue")
78-
* ```
79-
*
80-
* @see prop
81-
*/
82-
@Deprecated(
83-
"Use an overload with explicit name and extract",
84-
ReplaceWith("this.prop(\"NAME\") { callable.call(it) }", "assertk.assertions.prop"),
85-
level = DeprecationLevel.ERROR
86-
)
87-
@Suppress("SwallowedException")
88-
fun <T, P> Assert<T>.prop(callable: KCallable<P>) = prop(callable.name) {
89-
try {
90-
callable.call(it)
91-
} catch (e: InvocationTargetException) {
92-
// unwrap cause for a more helpful error message.
93-
throw e.cause!!
94-
}
95-
}
96-
9769
/**
9870
* Like [isEqualTo] but reports exactly which properties differ. Only supports data classes. Note: you should
9971
* _not_ use this if your data class has a custom [Any.equals] since it can be misleading.

0 commit comments

Comments
 (0)