X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fdump.impure-cload.lisp;h=2b1ad115458289473c804d2f5ca722c8ba53adea;hb=920649d1915aa94b4af894b7284c3a52b11cdf0f;hp=614e5c7b1fcec5ff36d5f468a9dd8df812f89dca;hpb=4d50265fe5a3dd4ea5b35c8ec12fe2b88721d22c;p=sbcl.git diff --git a/tests/dump.impure-cload.lisp b/tests/dump.impure-cload.lisp index 614e5c7..2b1ad11 100644 --- a/tests/dump.impure-cload.lisp +++ b/tests/dump.impure-cload.lisp @@ -28,7 +28,7 @@ (declare (type list keys)) (loop for c in '#1=("Red" "Blue" . #1#) - for key in keys )) + for key in keys)) ;;; sbcl-0.6.11.25 or so had DEF!STRUCT/MAKE-LOAD-FORM/HOST screwed up ;;; so that the compiler couldn't dump pathnames. @@ -59,4 +59,35 @@ (defparameter *path* #p"MY-LOGICAL-HOST:FOO;BAR.LISP") +;;; Non-SIMPLE-ARRAY VECTORs should be dumpable, though they can lose +;;; their complex attributes. + +(defparameter *string* #.(make-array 3 :initial-element #\a + :fill-pointer 2 + :element-type 'character)) + +;;; SBCL 0.7.8 incorrectly read high bits of (COMPLEX DOUBLE-FLOAT) +;;; components as unsigned bytes. +(defparameter *numbers* + '(-1s0 -1f0 -1d0 -1l0 + #c(-1s0 -1s0) #c(-1f0 -1f0) #c(-1d0 -1d0) #c(-1l0 -1l0))) + +;;; tests for MAKE-LOAD-FORM-SAVING-SLOTS +(eval-when (:compile-toplevel :load-toplevel :execute) + (defstruct savable-structure + (a nil :type symbol) + (b nil :type symbol :read-only t) + (c nil :read-only t) + (d 0 :type fixnum) + (e 17 :type (unsigned-byte 32) :read-only t)) + (defmethod make-load-form ((s savable-structure) &optional env) + (make-load-form-saving-slots s :environment env))) +(defparameter *savable-structure* + #.(make-savable-structure :a t :b 'frob :c 1 :d 39 :e 19)) +(assert (eql (savable-structure-a *savable-structure*) t)) +(assert (eql (savable-structure-b *savable-structure*) 'frob)) +(assert (eql (savable-structure-c *savable-structure*) 1)) +(assert (eql (savable-structure-d *savable-structure*) 39)) +(assert (eql (savable-structure-e *savable-structure*) 19)) + (sb-ext:quit :unix-status 104) ; success