PropCheck.trap_exit
You're seeing just the macro
trap_exit
, go back to PropCheck module for more information.
If the code inside prop
spawns and links to a process that dies
abnormally, PropEr will catch the exit signal and treat it as a test
failure, instead of crashing.
trap_exit
cannot contain any more wrappers.
iex> use PropCheck
iex> quickcheck(
...> trap_exit(forall n <- nat() do
...> # this must fail
...> _pid = spawn_link(fn() -> n / 0 end)
...> # wait for arrivial of the dieing linked process signal
...> :timer.sleep(50)
...> true #
...> end)
...> )
false