infix fun <T : CharSequence> Expect<T>.matches(expected: Regex): Expect<T>
(source)
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") matches "A(B)?C".toRegex() // subject is fully matched
fails { // because subject isn't fully matched, use containsRegex for partial matching
expect("ABC") matches "A".toRegex()
}
Return
This assertion container to support a fluent API.
Since
0.12.0