like
ErrorsCollection

like

Synthesised documentation from type/Test

From type/Test

See Original text in context

sub like(Str() $gotRegex:D $expected$desc = "text matches $expected.raku()")

Use it this way:

like 'foo', /fo/'foo looks like fo';

Marks a test as passed if the first parameter, when coerced to a string, matches the regular expression specified as the second parameter. The function accepts an optional description of the test with a default value printing the expected match.