fails-like
ErrorsCollection

fails-like

Synthesised documentation from type/Test

From type/Test

See Original text in context

sub fails-like ( \test where Callable:D|Str:D$ex-type$reason?*%matcher)

Same interface as throws-like, except checks that the code returns a Failures instead of throwing. If the code does throw or if the returned Failures has already been handled, that will be considered as a failed test.

fails-like { +"a" }X::Str::Numeric,
    :message(/'Cannot convert string to number'/),
    'converting non-numeric string to number fails';