Class

SemanticsMatcher

Wrapper for semantics matcher lambdas that allows to build string explaining to the developer what conditions were being tested.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Common
class SemanticsMatcher(val description: String, private val matcher: (SemanticsNode) -> Boolean)

Wrapper for semantics matcher lambdas that allows to build string explaining to the developer what conditions were being tested.

Functions

matches

fun matches(node: SemanticsNode): Boolean

Returns whether the given node is matched by this matcher.


matchesAny

fun matchesAny(nodes: Iterable<SemanticsNode>): Boolean

Returns whether at least one of the given nodes is matched by this matcher.


and

infix fun and(other: SemanticsMatcher): SemanticsMatcher

or

infix fun or(other: SemanticsMatcher): SemanticsMatcher

not

operator fun not(): SemanticsMatcher

Companion Object

Methods


expectValue

Common
fun <T> expectValue(key: SemanticsPropertyKey<T>, expectedValue: T): SemanticsMatcher

Builds a predicate that tests whether the value of the given key is equal to expectedValue.


keyIsDefined

Common
fun <T> keyIsDefined(key: SemanticsPropertyKey<T>): SemanticsMatcher

Builds a predicate that tests whether the given key is defined in semantics.


keyNotDefined

Common
fun <T> keyNotDefined(key: SemanticsPropertyKey<T>): SemanticsMatcher

Builds a predicate that tests whether the given key is NOT defined in semantics.