From: Taylor R Campbell Date: Wed, 7 Nov 2018 17:20:23 +0000 (+0000) Subject: Test that make-random-source is deterministic. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~116^2~20 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=56fe246ffa7aaf1ba863e918bbc910e67887a584;p=mit-scheme.git Test that make-random-source is deterministic. --- diff --git a/tests/runtime/test-random.scm b/tests/runtime/test-random.scm index d68aa8286..bd12ab2b5 100644 --- a/tests/runtime/test-random.scm +++ b/tests/runtime/test-random.scm @@ -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))