Fix 14 wave-4 re-review findings (batches w4a+w4b)

This commit is contained in:
venomade committed 2026-11-22 12:23:01 +00:00
1 parent a28a35991f
commit fd5e11cdeb
23 files changed
+98 -29

No files matched your search

+2
View File
@@ -39,3 +39,5 @@
(check-equal (list 0 0 0) (fill (list 1 2 3) 0))
(check-equal '(post-office::stuffed crate)
(funcall (find-symbol "FILL" '#:post-office) 'crate))
(check (member "FILL" (package-shadowing-symbols '#:post-office)
:test #'string= :key #'symbol-name))
+6 -2
View File
@@ -18,8 +18,12 @@
;;; them unchanged.
;;; ------------------------------------------------------------------
(check (let ((q (double-point (make-instance 'point :x 3 :y 4))))
(and (eql 6 (point-x q)) (eql 8 (point-y q)))))
(check (let* ((p (make-instance 'point :x 3 :y 4))
(q (double-point p)))
(and (not (eq q p))
(eql 3 (point-x p))
(eql 6 (point-x q))
(eql 8 (point-y q)))))
(check (let ((p (shift-x (make-instance 'point :x 1))))
(eql 2 (point-x p))))
(check (let ((p (shift-x (make-instance 'point :x 10))))
+12 -1
View File
@@ -11,6 +11,11 @@
(defgeneric purr (a))
(defmethod purr ((a animal))
"prrr-from-animal")
(defgeneric hiss (a))
(defmethod announce ((d dog))
(concatenate 'string (call-next-method) " Woof!"))
@@ -19,6 +24,11 @@
(call-next-method)
"Prrr"))
(defmethod hiss ((c cat))
(if (next-method-p)
(call-next-method)
"Prrr"))
;;; ------------------------------------------------------------------
;;; Checks. Read them - they tell you what to aim for - but leave
;;; them unchanged.
@@ -26,4 +36,5 @@
(check-equal "I am an animal. Woof!" (announce (make-instance 'dog)))
(check-equal "I am an animal." (announce (make-instance 'animal)))
(check-equal "Prrr" (purr (make-instance 'cat)))
(check-equal "prrr-from-animal" (purr (make-instance 'cat)))
(check-equal "Prrr" (hiss (make-instance 'cat)))
+7
View File
@@ -33,8 +33,15 @@
(empty-cart (c) (format nil "~a" c))))
(check-equal '(battery 15) (battery-check 15))
(check-equal '(battery 90) (battery-check 90))
(check-equal :noticed (handler-case (battery-check 15)
(warning () :noticed)))
(check-equal :noticed (handler-case (warn "battery low")
(warning () :noticed)))
(check-equal :swapped (handler-case (check-battery 5)
(low-battery () :swapped)))
(check-equal '(battery 20) (check-battery 20))
(check-equal :swapped (handler-case (check-battery 10)
(low-battery () :swapped)))
(check-equal '(battery 11)
(handler-case (check-battery 11)
(low-battery () :leaked)))