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

AssertSyntax

interface AssertSyntax

Allows to provide expected behaviours.

See Also

CompilerTest.assert

Properties

compiles Checks that code snippet compiles successfully.abstract val compiles: SingleAssert
emptyAssert abstract val emptyAssert: SingleAssert
fails Checks that code snippet fails.abstract val fails: SingleAssert
source Returns a Source object from a String.open val String.source: Source

Functions

allOf Allows to provide several Assert.SingleAssert.open fun allOf(vararg elements: SingleAssert): Assertopen fun allOf(elements: List<SingleAssert>): Assert
evalsTo Checks if a code snippet evals to a provided value after the compilation. This operation loads all the generated classes and run the code snippet by reflection.open infix fun Source.evalsTo(value: Any?): SingleAssert
failsWith Checks both that code snippet fails and the error message has a certain property which is checked by a provided function.open fun failsWith(f: (String) -> Boolean): SingleAssert
plus Allows to provide several Assert.SingleAssert.open operator fun SingleAssert.plus(other: SingleAssert): Assert
quoteFileMatches Checks that quote output during the compilation matches with the code snippet provided for a specific file.open fun quoteFileMatches(filename: String, source: Source): SingleAssert
open fun quoteFileMatches(filename: String, source: Source, sourcePath: Path): SingleAssert
quoteOutputMatches Checks that quote output during the compilation matches with the code snippet provided.open fun quoteOutputMatches(source: Source): SingleAssert

Do you like Arrow?

Arrow Org
<