January 2019
Intermediate to advanced
376 pages
8h 49m
English
We’ll start with a very wide scanning of the system to make sure the basic stuff works. This will check for simple API misunderstandings, errors that type analysis couldn’t reveal, or issues with configuration or the basic test setup.
Let’s first add the actual property declaration to our module:
| | Erlang code/Bookstore/erlang/bookstore/test/prop_bookstore.erl |
| | -module(prop_bookstore). |
| | -include_lib("proper/include/proper.hrl"). |
| | -compile(export_all). |
| | prop_test() -> |
| | ?SETUP(fun() -> |
| | {ok, Apps} = application:ensure_all_started(bookstore), |
| | fun() -> [application:stop(App) || App <- Apps], ok end |
| | end, |
| | ?FORALL(Cmds, commands(?MODULE), |
| | begin |
| | bookstore_db:setup(), |
| | {History, State, Result} ... |