Macros

Let's understand what check all and gen all macros are.

We'll cover the following

This lesson will introduce you to the check all and gen all macros. Let’s do it.

The check all macro

The check all supports multiple <- clauses. It also supports simple assignments (with =) as well as expressions that are used as filters, similar to what for supports.

To show a more complex use of check all, let’s write an example of a test that does the following:

  1. Generate a list
  2. Filter out empty lists
  3. Generate an element taken out of that list and finally
  4. Check that the in operator always returns true for the two generated terms.

Here is how it looks:

Get hands-on with 1200+ tech skills courses.