Resizing Generators
Understand the concept of resizing and how to use the resize function in properties.
We'll cover the following...
What is resizing?
Resizing is the process that makes generators grow bigger:
- Make an integer larger.
- Make a list longer.
- Make a string have larger codepoints.
This is the simplest thing to do with custom generators.
In fact, PropEr makes that happen for us on its own as the tests run. The way generator growth works is that PropEr internally uses a size parameter. Its value is usually small at first, but as tests run, the value is increased, and the data generated grows in complexity along with it. This allows the framework to start testing our systems with initially small data, and to then progressively make it more complex.
Resizing is part of a strategy to find easy edge conditions such as 0, empty ...
Access this course and 1400+ top-rated courses and projects.