Carp/test/random.carp
2018-11-08 07:16:52 +01:00

16 lines
416 B
Plaintext

(load "Test.carp")
(use-all Random Test)
(deftest test
(assert-op test
0.658908
(Random.random)
"deterministic randomization works as expected"
Double.approx)
(assert-op test
0.536041
(do (Random.seed-from 33333.0) (Random.random))
"deterministic randomization with seed works as expected"
Double.approx))