From 989ffe8066007c35c8607945ca28a1b0893cdc9f Mon Sep 17 00:00:00 2001
From: Pierre Fenoll <pierrefenoll@gmail.com>
Date: Wed, 27 Jun 2018 18:58:12 +0200
Subject: [PATCH] seed: test with no seed & with another seed

---
 test/proper_tests.erl | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/test/proper_tests.erl b/test/proper_tests.erl
index 194a71cd..8fef30a0 100644
--- a/test/proper_tests.erl
+++ b/test/proper_tests.erl
@@ -1043,19 +1043,30 @@ options_test_() ->
 
 seeded_test_() ->
     Seed = os:timestamp(),
-    Opts = [{seed,Seed}, noshrink, {start_size,65536}],
+    BaseOpts = [noshrink, {start_size,65536}],
     QC = fun (Prop) ->
-                 R = proper:counterexample(Prop, Opts),
+                 R = proper:counterexample(Prop, [{seed,Seed}|BaseOpts]),
                  proper:clean_garbage(),
                  R
          end,
-    [[?_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)]
-    ].
+    NC = fun (Prop) ->
+                 R = proper:counterexample(Prop, BaseOpts),
+                 proper:clean_garbage(),
+                 R
+         end,
+    OC = fun (Prop) ->
+                 OtherSeed = os:timestamp(),
+                 R = proper:counterexample(Prop, [{seed,OtherSeed}|BaseOpts]),
+                 proper:clean_garbage(),
+                 R
+         end,
+    [[?_state_is_clean(), ?_assertEqual(QC(Prop),Check),
+      ?_state_is_clean(), ?_assertNotEqual(NC(Prop),Check),
+      ?_state_is_clean(), ?_assertNotEqual(OC(Prop),Check)]
+     || Prop <- [?FORALL(_, integer(), false),
+                 ?FORALL(_, integer(), ?TRAPEXIT(false)),
+                 ?FORALL_TARGETED(I, integer(), begin ?MAXIMIZE(I),false end)],
+        Check <- [QC(Prop)]].
 
 setup_prop() ->
     ?SETUP(fun () ->