Commit 527c8d33 authored by pfdietz's avatar pfdietz
Browse files

Add :size parameter to functions produced by def-random-write-test-fun

parent 12b114ae
...@@ -313,13 +313,13 @@ ...@@ -313,13 +313,13 @@
&key &key
(prefix "") (prefix "")
(suffix "")) (suffix ""))
`(defun ,name (n) `(defun ,name (n &key (size 10))
(loop (loop
for args = (make-random-write-args) for args = (make-random-write-args)
for package = (find-package (random-from-seq #("CL-TEST" "CL-USER" "KEYWORD"))) for package = (find-package (random-from-seq #("CL-TEST" "CL-USER" "KEYWORD")))
for obj = (let ((*random-readable* t)) for obj = (let ((*random-readable* t))
(declare (special *random-readable*)) (declare (special *random-readable*))
(random-thing (random 10))) (random-thing (random size)))
for s1 = (let ((*package* package)) for s1 = (let ((*package* package))
(with-output-to-string (s) (apply #'write obj :stream s ,@write-args args))) (with-output-to-string (s) (apply #'write obj :stream s ,@write-args args)))
for s2 = (let ((*package* package)) for s2 = (let ((*package* package))
...@@ -331,7 +331,7 @@ ...@@ -331,7 +331,7 @@
;; if they contain object addresses. ;; if they contain object addresses.
unless (string= (filter-unreadable-forms (concatenate 'string ,prefix s1 ,suffix)) unless (string= (filter-unreadable-forms (concatenate 'string ,prefix s1 ,suffix))
(filter-unreadable-forms s2)) (filter-unreadable-forms s2))
collect (list obj s1 s2)))) collect (list obj s1 s2 args))))
(def-random-write-test-fun random-write-test nil #'write) (def-random-write-test-fun random-write-test nil #'write)
(def-random-write-test-fun random-prin1-test (:escape t) #'prin1) (def-random-write-test-fun random-prin1-test (:escape t) #'prin1)
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