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

Shrinking

Question 1

  • ?SHRINK(Generator, [AltGenerators, ...])
  • ?LETSHRINK([Pattern, ...], [Generator, ...], Expression)

Question.

Question 2

?LETSHRINK always takes a list of arguments and generators, whereas ?LET takes any pattern and any generator in its first two arguments. When failing in a test case and needing a new simplified generator, one of the generators in the list will be used, but without the transformations being applied. A ?LET macro has no such rule and the transformation is always applied.

Question.

Question 3

The problem here is that the property expects a list coming out of the generator, but the way ?LETSHRINK works is that every single of the variable between Appetizer, Drink, Entree, or Dessert is an atom put in a list. During ...

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