File Structure
Understand the test file structure of Erlang and Elixir as well as the sections in the test file.
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 base
command to generate a test file namedprop_base.erl
.
The files contain two parts:
- The test module,
module(prop_base)
for Erlang anddefmodule PbtTest
for Elixir. - A test suite which contains three sections:
- The properties we want to test
- The helper functions
- The custom data generators
Get hands-on with 1400+ tech skills courses.