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

containsRegex

infix fun <T : CharSequence> Expect<T>.containsRegex(pattern: String): Expect<T> (source)
Deprecated: Use toContainRegex; will be removed with 1.0.0 at the latest

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"
}

Parameters

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.