Dividing with let_shrink

Learn the let_shrink macro and where it can come in handy to understand the test cases that fail.

We'll cover the following...

The let_shrink macro

As we use PropEr, we sometimes get stuck with generators creating huge data structures that take a long time to shrink and often don’t give very interesting results back. This often happens when some very low-probability failure is triggered, meaning that the framework had to generate a lot of data to find it, and has limited chances of shrinking things in a significant manner.

Whenever that happens, the let_shrink([Pattern, ...], [Generator, ...], Expression) is what we need. Let’s take a look at how we can use the generators in practice.

let_shrink([
    a
...