Skip to content

Commit

Permalink
test with non-fixed seed + test ?TRAPEXIT/1
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp committed May 18, 2018
1 parent 5532ffb commit 8dc48c8
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions test/proper_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1041,24 +1041,19 @@ options_test_() ->
[{start_size,12}])].

seeded_test_() ->
Seed = {1526,530081,919799},
Seed = os:timestamp(),
Opts = [{seed,Seed}, noshrink, {start_size,65536}],
QC = fun (Prop) ->
R = proper:quickcheck(Prop,Opts),
R = proper:quickcheck(Prop, Opts),
proper:clean_garbage(),
R
end,
Prop = ?FORALL(_,integer(),false),
Check = QC(Prop),
IsClean = state_is_clean(),
PropSA = ?FORALL_TARGETED(I,integer(), begin ?MAXIMIZE(I),false end),
CheckSA = QC(PropSA),
IsCleanSA = state_is_clean(),
[?_assert(IsClean)
,?_assertEqual(QC(Prop), Check)
,?_assert(IsCleanSA)
,?_assertEqual(QC(PropSA), CheckSA)
%% ,?_assertEqual(Check(PropSA), Check(Prop))
[[?_assert(state_is_clean()), ?_assertEqual(QC(Prop),Check)]
|| Prop <- [?FORALL(_, integer(), false)
,?FORALL(_, integer(), ?TRAPEXIT(false))
,?FORALL_TARGETED(I, integer(), begin ?MAXIMIZE(I),false end)
],
Check <- [QC(Prop)]
].

setup_prop() ->
Expand Down

0 comments on commit 8dc48c8

Please sign in to comment.