From 56fe246ffa7aaf1ba863e918bbc910e67887a584 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 7 Nov 2018 17:20:23 +0000 Subject: [PATCH] Test that make-random-source is deterministic. --- tests/runtime/test-random.scm | 7 +++++++ 1 file changed, 7 insertions(+) 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)) -- 2.25.1