File Structure
Explore the structure of property-based test files in Elixir and Erlang projects using PropEr. Understand how to organize properties, helper functions, and custom data generators to write clear and maintainable test suites. This lesson helps you grasp the recommended file layout and roles of each section for effective property-based testing.
We'll cover the following...
We'll cover the following...
General file structure
The prop_base file created in Erlang and the pbt_test.exs file created in Elixir are the project’s test files. Both have a similar structures as we’ll see below,
Elixir creates the test files by itself. However, Erlang does not. In the root of any standard Erlang project, call the
rebar3 new proper basecommand to generate a test file namedprop_base.erl.
The files contain two parts:
- The test module,