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 declaring argument matchers.

Functions

Link copied to clipboard

Matches any argument.

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

Matches argument that is greater than value.

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

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

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

Matches argument that is less than value.

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

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

Link copied to clipboard

Matches argument that satisfies a matcher.

fun <T> MokkeryMatcherScope.matches(toString: () -> String, predicate: (T) -> Boolean): T

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

Link copied to clipboard
fun <T> MokkeryMatcherScope.matchesBy(function: (T) -> Boolean): T

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

Link copied to clipboard

DEPRECATED Matches an argument that satisfies a composite matcher created by builder from matchers.

Link copied to clipboard

Returns the ArgMatcher object behind matcher. A literal value is returned as ArgMatcher.Equals.

fun <T> MokkeryMatcherScope.materialize(vararg matchers: T): List<ArgMatcher<T>>

Like single-value materialize, but for many matchers at once, including vararg parameters marked with Matcher. Returns their ArgMatcher objects in order.

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

Matches an argument that is an instance of type T.

Link copied to clipboard
fun <T> MokkeryMatcherScope.ref(value: T): T

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