doc / ch.tutteli.atrium.api.infix.en_GB / matches

matches

infix fun <T : CharSequence> Expect<T>.matches(expected: Regex): Expect<T> (source)
Deprecated: Use toMatch; will be removed with 1.0.0 at the latest

Expects that the subject of this expectation (a CharSequence) matches the given expected.

In contrast to containsRegex it does not look for a partial match but for an entire match.

expect("ABC") toMatch "A(B)?C".toRegex() // subject is fully matched

fails { // because subject isn't fully matched, use containsRegex for partial matching
    expect("ABC") toMatch "A".toRegex()
}

Return
an Expect for the subject of this expectation.

Since
0.12.0