Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment