kotest-assertions / io.kotest.matchers

Package io.kotest.matchers

Types

Diff

sealed class Diff

Matcher

A Matcher is the main abstraction in the assertions library.

interface Matcher<T>

MatcherResult

An instance of MatcherResult contains the result of an evaluation of a Matcher.

interface MatcherResult

Extensions for External Classes

kotlin.Any

Functions

be

fun <T> be(expected: T): Matcher<T>

beInstanceOf

fun beInstanceOf(expected: KClass<*>): Matcher<Any?>
fun <T : Any> beInstanceOf(): Matcher<Any?>

beInstanceOf2

fun <U : Any, T : U> beInstanceOf2(): Matcher<U>

beOfType

fun beOfType(expected: KClass<*>): Matcher<Any?>
fun <T : Any> beOfType(): Matcher<Any?>

beTheSameInstanceAs

fun <T> beTheSameInstanceAs(ref: T): Matcher<T>

equalityMatcher

fun <T> equalityMatcher(expected: T): Matcher<T>

haveSameHashCodeAs

fun haveSameHashCodeAs(other: Any): Matcher<Any>

instanceOf

fun instanceOf(expected: KClass<*>): Matcher<Any?>

should

infix fun <T> T.should(matcher: Matcher<T>): Unit
infix fun <T> T.should(matcher: (T) -> Unit): Unit

shouldBe

infix fun <T, U : T> T.shouldBe(any: U?): Unit

shouldHave

infix fun <T> T.shouldHave(matcher: Matcher<T>): Unit

shouldNot

infix fun <T> T.shouldNot(matcher: Matcher<T>): Unit

shouldNotBe

infix fun <T> T.shouldNotBe(any: Any?): Unit

shouldNotHave

infix fun <T> T.shouldNotHave(matcher: Matcher<T>): Unit