Module : Module

T - Easy way of writing test assertions which output good test descriptions and error messages in Raku

After I finished watching Daniel Sockwell's FOSDEM 2022 Raku presentation, I thought this is a good opportunity to play with Raku's slangs, something I hadn't done before.

What is Daniel's talk(and upcoming module) and my module going to solve?

  • Write less but more readable test code
  • Get a useful test description and failure message

If you use cmp-ok, you get a good error message; but without a test description it's sometimes hard to understand. Also cmp-ok and other test functions(most of them, use-ok being an exception for example) do not output anything on a successful test, unless you provide the description yourself. I personally think that test sub routines should generate a description if one is not provided. But of course that cannot be done with simple functions. Maybe the Test module needs to be rethought in the future?