瀏覽代碼

dealing with unused variable warnings

lisp-unit.lsp had a few unused variable warnings that have been declared
as (ignore). Also koans/lists.lsp had an unused variable some-events
because of no asserts on that variable.
Filip Koczorowski 12 年之前
父節點
當前提交
90d4c4ae7f
共有 2 個文件被更改,包括 10 次插入1 次删除
  1. 1 1
      koans/lists.lsp
  2. 9 0
      lisp-unit.lsp

+ 1 - 1
koans/lists.lsp

@@ -24,7 +24,7 @@
24 24
     (setf fruits '(orange pomello clementine))
25 25
     (setf some-evens (list (* 2 1) (* 2 2) (* 2 3)))
26 26
     (assert-equal fruits ___)
27
-    (assert-equal ___ (length fruits))))
27
+    (assert-equal ___ (length some-evens))))
28 28
 
29 29
 
30 30
 (define-test test-list-cons

+ 9 - 0
lisp-unit.lsp

@@ -190,6 +190,7 @@ assertion.")
190 190
 
191 191
 (defmethod print-failure :around (type form expected actual extras)
192 192
   "Failure header and footer output."
193
+  (declare (ignore expected actual))
193 194
   (format t "~& | Failed Form: ~S" form)
194 195
   (call-next-method)
195 196
   (when extras
@@ -198,22 +199,26 @@ assertion.")
198 199
   type)
199 200
 
200 201
 (defmethod print-failure (type form expected actual extras)
202
+  (declare (ignore type form extras))
201 203
   (format t "~& | Expected ~{~S~^; ~} " expected)
202 204
   (format t "~<~% | ~:;but saw ~{~S~^; ~}~>" actual))
203 205
 
204 206
 (defmethod print-failure ((type (eql :error))
205 207
                           form expected actual extras)
208
+  (declare (ignore form extras))
206 209
   (format t "~& | ~@[Should have signalled ~{~S~^; ~} but saw~]"
207 210
           expected)
208 211
   (format t " ~{~S~^; ~}" actual))
209 212
 
210 213
 (defmethod print-failure ((type (eql :macro))
211 214
                           form expected actual extras)
215
+  (declare (ignore form extras))
212 216
   (format t "~& | Should have expanded to ~{~S~^; ~} " expected)
213 217
   (format t "~<~%~:;but saw ~{~S~^; ~}~>" actual))
214 218
 
215 219
 (defmethod print-failure ((type (eql :output))
216 220
                           form expected actual extras)
221
+  (declare (ignore form extras))
217 222
   (format t "~& | Should have printed ~{~S~^; ~} " expected)
218 223
   (format t "~<~%~:;but saw ~{~S~^; ~}~>" actual))
219 224
 
@@ -474,6 +479,7 @@ assertion.")
474 479
 
475 480
 (defmethod test-passed-p ((type (eql :error)) expected actual test)
476 481
   "Return the result of the error assertion."
482
+  (declare (ignore test))
477 483
   (or
478 484
    (eql (car actual) (car expected))
479 485
    (typep (car actual) (car expected))))
@@ -486,10 +492,12 @@ assertion.")
486 492
 
487 493
 (defmethod test-passed-p ((type (eql :macro)) expected actual test)
488 494
   "Return the result of the macro expansion."
495
+  (declare (ignore test))
489 496
   (equal (car actual) (car expected)))
490 497
 
491 498
 (defmethod test-passed-p ((type (eql :output)) expected actual test)
492 499
   "Return the result of the printed output."
500
+  (declare (ignore test))
493 501
   (string=
494 502
    (string-trim '(#\newline #\return #\space) (car actual))
495 503
    (car expected)))
@@ -501,6 +509,7 @@ assertion.")
501 509
 
502 510
 (defmethod test-passed-p ((type (eql :result)) expected actual test)
503 511
   "Return the result of the assertion."
512
+  (declare (ignore test))
504 513
   (logically-equal (car actual) (car expected)))
505 514
 
506 515
 (defun form-contains-one-of-p (form symbol-list)