Commit 4124c914 authored by pfdietz's avatar pfdietz
Browse files

Tweak the random state printing test so that rs1 is a copy of the random...

Tweak the random state printing test so that rs1 is a copy of the random state.  This protects against the possibility that *random-sate* is being modified elsewhere in the background during the test.
parent 913d061b
......@@ -8,11 +8,13 @@
(compile-and-load "printer-aux.lsp")
(deftest print.random-state.1
(let* ((rs1 *random-state*)
(rs2 (with-standard-io-syntax
(read-from-string
(write-to-string rs1 :readably t)))))
(values
(notnot (random-state-p rs2))
(is-similar rs1 rs2)))
t t)
(loop repeat 100
nconc
(let* ((rs1 (make-random-state *random-state*))
(rs2 (with-standard-io-syntax
(read-from-string
(write-to-string rs1 :readably t))))
(result (list (notnot (random-state-p rs2))
(is-similar rs1 rs2))))
(unless (equal result '(t t)) (list result rs1 rs2))))
nil)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment