Skip to content

Commit e5f5e42

Browse files
committed
Add secondary constructor to EngineResult for simplified instantiation with errors list
1 parent a2019de commit e5f5e42

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

kotest-assertions/kotest-assertions-core/src/commonMain/kotlin/io/kotest/matchers/InvokeMatcher.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import io.kotest.assertions.Expected
77
import io.kotest.assertions.print.Printed
88
import io.kotest.assertions.print.print
99

10+
@Suppress("DEPRECATION")
1011
fun <T> invokeMatcher(t: T, matcher: Matcher<T>): T {
1112
assertionCounter.inc()
1213
val result = matcher.test(t)

kotest-framework/kotest-framework-engine/api/kotest-framework-engine.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2968,6 +2968,7 @@ public final class io/kotest/datatest/WordSpecWhenContainerScopeKt {
29682968

29692969
public final class io/kotest/engine/EngineResult {
29702970
public static final field Companion Lio/kotest/engine/EngineResult$Companion;
2971+
public fun <init> (Ljava/util/List;)V
29712972
public fun <init> (Ljava/util/List;Z)V
29722973
public final fun addError (Ljava/lang/Throwable;)Lio/kotest/engine/EngineResult;
29732974
public final fun addErrors (Ljava/util/List;)Lio/kotest/engine/EngineResult;

kotest-framework/kotest-framework-engine/src/commonMain/kotlin/io/kotest/engine/TestEngine.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ data class EngineResult(
1818
val testFailures: Boolean,
1919
) {
2020

21+
constructor(errors: List<Throwable>) : this(errors, false)
22+
2123
companion object {
2224
val empty = EngineResult(emptyList(), false)
2325
}

0 commit comments

Comments
 (0)