Test that make-random-source is deterministic.
authorTaylor R Campbell <campbell@mumble.net>
Wed, 7 Nov 2018 17:20:23 +0000 (17:20 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Wed, 7 Nov 2018 17:20:23 +0000 (17:20 +0000)
tests/runtime/test-random.scm

index d68aa828661ff5854c2dba66e9d1d29ba85e9a47..bd12ab2b51238011c7170343fd8c7a68a9d11a09 100644 (file)
@@ -43,6 +43,13 @@ USA.
       (assert-!= ((random-source-make-integers s0) (expt 2 32))
                 ((random-source-make-integers s1) (expt 2 32))))))
 
+(define-test 'random-source-fresh-deterministic
+  (lambda ()
+    (let* ((s0 (make-random-source))
+          (s1 (make-random-source)))
+      (assert-= ((random-source-make-integers s0) (expt 2 64))
+               ((random-source-make-integers s1) (expt 2 64))))))
+
 (define-test 'random-source-randomize!
   (lambda ()
     (let* ((s0 (make-random-state #t))