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 @@ ...@@ -8,11 +8,13 @@
(compile-and-load "printer-aux.lsp") (compile-and-load "printer-aux.lsp")
(deftest print.random-state.1 (deftest print.random-state.1
(let* ((rs1 *random-state*) (loop repeat 100
(rs2 (with-standard-io-syntax nconc
(read-from-string (let* ((rs1 (make-random-state *random-state*))
(write-to-string rs1 :readably t))))) (rs2 (with-standard-io-syntax
(values (read-from-string
(notnot (random-state-p rs2)) (write-to-string rs1 :readably t))))
(is-similar rs1 rs2))) (result (list (notnot (random-state-p rs2))
t t) (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