Package-level declarations

Types

Link copied to clipboard
fun interface ArgMatcher<in T>

Checks if given argument satisfies provided conditions.

Link copied to clipboard

Scope for registering argument matchers.

Functions

Link copied to clipboard
inline fun <T> ArgMatchersScope.any(): T

Matches any argument.

Link copied to clipboard
inline fun <T> ArgMatchersScope.eq(value: T): T

Matches an argument that is equal to value. It can be replaced with value literal.

Link copied to clipboard
inline fun <T> ArgMatchersScope.eqRef(value: T): T

Matches an argument whose reference is equal to value's reference.

Link copied to clipboard
inline fun <T : Comparable<T>> ArgMatchersScope.gt(value: T): T

Matches argument that is greater than value.

Link copied to clipboard
inline fun <T : Comparable<T>> ArgMatchersScope.gte(value: T): T

Matches an argument that is greater than or equal to value.

Link copied to clipboard
inline fun <T : Comparable<T>> ArgMatchersScope.lt(value: T): T

Matches argument that is less than value.

Link copied to clipboard
inline fun <T : Comparable<T>> ArgMatchersScope.lte(value: T): T

Matches an argument that is less than or equal to value.

Link copied to clipboard

Registers matcher with T::class as argument type.

Link copied to clipboard
inline fun <T> ArgMatchersScope.matching(noinline toString: () -> String = { "matching(...)" }, noinline predicate: (T) -> Boolean): T

Matches an argument according to the predicate. Registered matcher Any.toString calls toString.

Link copied to clipboard
inline fun <T> ArgMatchersScope.matchingBy(function: (T) -> Boolean): T

Matches an argument by calling given function. Also, it returns function name on Any.toString.

Link copied to clipboard
inline fun <T> ArgMatchersScope.neq(value: T): T

Matches an argument that is not equal to value.

Link copied to clipboard
inline fun <T> ArgMatchersScope.neqRef(value: T): T

Matches an argument whose reference is not equal to value's reference.

Link copied to clipboard
inline fun <T> ArgMatchersScope.ofType(): T

Matches an argument that is an instance of type T.