Mercurial > hg > xemacs-beta
comparison tests/automated/test-harness.el @ 2056:ab71063baf27
[xemacs-hg @ 2004-05-03 15:08:41 by james]
Add failing-case parameter to Assert and use it in lisp-tests.
author | james |
---|---|
date | Mon, 03 May 2004 15:08:51 +0000 |
parents | db7c7e251153 |
children | 3b1f8220a65e |
comparison
equal
deleted
inserted
replaced
2055:512c8189d646 | 2056:ab71063baf27 |
---|---|
208 (puthash ,reason (if (null count) 1 (1+ count)) | 208 (puthash ,reason (if (null count) 1 (1+ count)) |
209 skipped-test-reasons) | 209 skipped-test-reasons) |
210 (Print-Skip ,description ,reason)) | 210 (Print-Skip ,description ,reason)) |
211 ,@body)) | 211 ,@body)) |
212 | 212 |
213 (defmacro Assert (assertion) | 213 (defmacro Assert (assertion &optional failing-case) |
214 `(condition-case error-info | 214 `(condition-case error-info |
215 (progn | 215 (progn |
216 (assert ,assertion) | 216 (assert ,assertion) |
217 (Print-Pass "%S" (quote ,assertion)) | 217 (Print-Pass "%S" (quote ,assertion)) |
218 (incf passes)) | 218 (incf passes)) |
219 (cl-assertion-failed | 219 (cl-assertion-failed |
220 (Print-Failure "Assertion failed: %S" (quote ,assertion)) | 220 (Print-Failure (if ,failing-case |
221 (incf assertion-failures)) | 221 "Assertion failed: %S; failing case = %S" |
222 (t (Print-Failure "%S ==> error: %S" (quote ,assertion) error-info) | 222 "Assertion failed: %S") |
223 (incf other-failures) | 223 (quote ,assertion) ,failing-case) |
224 ))) | 224 (incf assertion-failures)) |
225 (t (Print-Failure (if ,failing-case | |
226 "%S ==> error: %S; failing case = %S" | |
227 "%S ==> error: %S") | |
228 (quote ,assertion) error-info ,failing-case) | |
229 (incf other-failures) | |
230 ))) | |
231 | |
225 | 232 |
226 (defmacro Check-Error (expected-error &rest body) | 233 (defmacro Check-Error (expected-error &rest body) |
227 (let ((quoted-body (if (= 1 (length body)) | 234 (let ((quoted-body (if (= 1 (length body)) |
228 `(quote ,(car body)) `(quote (progn ,@body))))) | 235 `(quote ,(car body)) `(quote (progn ,@body))))) |
229 `(condition-case error-info | 236 `(condition-case error-info |