diff --git a/dsl/common/src/main/kotlin/io/mockk/Matchers.kt b/dsl/common/src/main/kotlin/io/mockk/Matchers.kt index 8aa5eb385..c9666ee08 100644 --- a/dsl/common/src/main/kotlin/io/mockk/Matchers.kt +++ b/dsl/common/src/main/kotlin/io/mockk/Matchers.kt @@ -59,7 +59,11 @@ data class FunctionMatcher( return if(arg == null) { false } else { - matchingFunc(arg) + try { + matchingFunc(arg) + } catch (a: AssertionError) { + false + } } }