VarArgMatcher

sealed interface VarArgMatcher : ArgMatcher<Any?>

Wildcard vararg matcher that checks a subset of varargs. It can occur only once. To provide your own implementation use Base.

Inheritors

Types

Link copied to clipboard
class AllThat<T>(type: KClass<*>, predicate: (T) -> Boolean) : VarArgMatcher.Base<T>

Matches a sequence of varargs with all elements matching the predicate.

Link copied to clipboard

Matches any sequence of varargs.

Link copied to clipboard
class AnyThat<T>(type: KClass<*>, predicate: (T) -> Boolean) : VarArgMatcher.Base<T>

Matches a sequence of varargs with any element matching the predicate.

Link copied to clipboard
abstract class Base<in T> : VarArgMatcher

Base class for any VarArgMatcher. Returns false if arg is not an array or list.

Functions

Link copied to clipboard
abstract fun matches(arg: Any?): Boolean
Link copied to clipboard

Helper function to propagate capture for dev.mokkery.matcher.ArgMatcher.Composite.