infix fun <T : CharSequence> Expect<T>.containsRegex(pattern: String): Expect<T>
(source)Expects that the subject of this
expectation (a CharSequence) contains a sequence which matches the given
regular expression pattern.
It is a shortcut for contains o atLeast 1 regex pattern
.
expect("ABC") toContainRegex "A(B)?"
fails {
expect("ABC") toContainRegex "X"
}
pattern
- The pattern which is expected to have a match against the input of the search.
Return
an Expect for the subject of this
expectation.