diff --git a/result4k/kotest/src/main/kotlin/dev/forkhandles/result4k/kotest/matchers.kt b/result4k/kotest/src/main/kotlin/dev/forkhandles/result4k/kotest/matchers.kt index 62525b4..1ac44d2 100644 --- a/result4k/kotest/src/main/kotlin/dev/forkhandles/result4k/kotest/matchers.kt +++ b/result4k/kotest/src/main/kotlin/dev/forkhandles/result4k/kotest/matchers.kt @@ -59,18 +59,18 @@ infix fun Result<*, E>.shouldBeFailure(block: (E) -> Unit) { infix fun Result<*, E>.shouldBeFailure(expected: E) = this should beFailure(expected) -private fun Result.matchesValue(value: Result): MatcherResult = +private fun Result.matchesValue(actual: Result): MatcherResult = matcherResultWithIntelliJDiff( - passed = value == this, - actual = toString(), - expected = value.toString() + passed = this == actual, + actual = this.toString(), + expected = actual.toString() ) -private fun > Result.matchesType(resultClass: KClass): MatcherResult = +private fun > Result.matchesType(expected: KClass): MatcherResult = matcherResultWithIntelliJDiff( - passed = resultClass.isInstance(this), + passed = expected.isInstance(this), actual = this.toString(), - expected = resultClass.simpleName!! + expected = expected.simpleName!! ) /**