mirror of
https://github.com/carp-lang/Carp.git
synced 2024-10-11 12:37:32 +03:00
18 lines
480 B
Plaintext
18 lines
480 B
Plaintext
(load "Test.carp")
|
|
|
|
(use-all Random Test)
|
|
|
|
(defn main []
|
|
(with-test test
|
|
(assert-op test
|
|
0.658908
|
|
(Random.random)
|
|
"deterministic randomization works as expected"
|
|
Double.approx)
|
|
(assert-op test
|
|
0.536041
|
|
(do (Random.seed 33333.0) (Random.random))
|
|
"deterministic randomization with seed works as expected"
|
|
Double.approx)
|
|
(print-test-results test)))
|