Skip to Main Content
Property-Based Testing with PropEr, Erlang, and Elixir
book

Property-Based Testing with PropEr, Erlang, and Elixir

by Fred Hebert
January 2019
Intermediate to advanced content levelIntermediate to advanced
376 pages
8h 49m
English
Pragmatic Bookshelf
Content preview from Property-Based Testing with PropEr, Erlang, and Elixir

Implementing Specials

So we have a more complex generator for specials, and a basic checkout implementation that doesn’t consider specials at all. We have everything we need to get started on implementing specials. Our first step should be making sure our test actually fails eventually, as a sanity check to know it’s good at detecting bad cases:

 $ ​​rebar3​​ ​​proper
 build information and other properties
 ===> Testing prop_checkout:prop_special()
 ......!
 Failed: After 7 test(s).
 {[[0],[6,1],[0],[0],[6,1],[6,1],[6,1],[0],[6,1],[6,1],[0],[6,1],[6,1],[6,1],
 [6,1],[6,1],[6,1],[6,1],[6,1],[0],[6,1],[6,1],[6,1],[0],[6,1],[0],[0],[6,1],
 [6,1],[6,1],[6,1],[0],[0],[0],[6,1],[6,1],[0]],20,[{[0],-2},{[6,1],1}],
 [{[0],2,3},{[6,1],5,0}]}
 
 
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Erlang and OTP in Action

Erlang and OTP in Action

Eric Merritt, Richard Carlsson, Martin Logan
Testing Elixir

Testing Elixir

Andrea Leopardi, Jeffrey Matthias

Publisher Resources

ISBN: 9781680506556Errata Page