Structure of Properties
Even though this chapter will focus on stateless properties, do know that all properties will share a common basic structure. Fancier stateful properties will only add content and special calls, but the core will remain the same. All properties go into files that contain an Erlang (or Elixir) test module, and must respect a specific format. What we’ll be looking for here is the structure we’ll use within these modules to let PropEr know what the rules to test are, and to let it know how to generate the data it should use to test them.
File Structure
Let’s start by taking another look at the code generated within an existing project when using the templates provided by rebar3’s PropEr plugin, so that you get a feel for ...
Get Property-Based Testing with PropEr, Erlang, and Elixir now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.