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
an Expect for the subject of this
expectation.
Since
0.9.0