Skip to content

Expectation::toMatchRegex ​

Member of Expectation

idl
Expectation.toMatchRegex, compare, $
  /_expect_failure

Verifies that an expectation value matches a regular expression.

Examples ​

idl
; verify there are numbers in our string
(it.expects('(42)')).toMatchRegex, '[0-9][0-9.]*'
(it.expects('no digits here'))._not_.toMatchRegex, '[0-9]+'

Arguments ​

compare ​

requiredinputtype=String

Specify a regular expression to find in the expectation value.

Keywords ​

_expect_failure {#kw-_expect_failure} ​

optionalinputtype=Boolean

If the test fails for some reason, set this to force passing because we expected failure. This keyword is for internal use only.

Licensed under MIT.