expectRegexMatch function

void expectRegexMatch(
  1. String value,
  2. RegExp regex, {
  3. String? reason,
  4. dynamic skip,
})

Expect that value matches with regex.

Implementation

void expectRegexMatch(
  String value,
  RegExp regex, {
  String? reason,
  dynamic skip, // true or a String
}) {
  final matcher = predicate<String>(
    (obj) => regex.hasMatch(obj),
    "Should MATCH the regular expression: /${regex.pattern}/",
  );
  expect(
    value,
    matcher,
    reason: reason,
    skip: skip,
  );
}