//arrow-meta-test/arrow.meta.plugin.testing/AssertSyntax/failsWith

failsWith

[jvm]
open fun failsWith(f: (String) -> Boolean): Assert.SingleAssert

Checks both that code snippet fails and the error message has a certain property which is checked by a provided function.

For instance:

failsWith { it.contains("Expecting a top level declaration") }

Parameters

jvm

   
f function that must return true from the error message as an input.

Do you like Arrow?

Arrow Org
<