Mercurial > hg > xemacs-beta
comparison tests/automated/test-harness.el @ 4845:a3c673c0720b
show description properly in Assert-failure message
-------------------- ChangeLog entries follow: --------------------
tests/ChangeLog addition:
2010-01-13 Ben Wing <ben@xemacs.org>
* automated/test-harness.el (test-harness-from-buffer):
Need to quote the assertion expression, but not the description
expression.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 13 Jan 2010 04:25:15 -0600 |
parents | 294a86d29f99 |
children | 189fb67ca31a |
comparison
equal
deleted
inserted
replaced
4844:91b3d00e717f | 4845:a3c673c0720b |
---|---|
273 Optional DESCRIPTION describes the assertion. | 273 Optional DESCRIPTION describes the assertion. |
274 FAILING-CASE and DESCRIPTION are useful when Assert is used in a loop." | 274 FAILING-CASE and DESCRIPTION are useful when Assert is used in a loop." |
275 `(condition-case error-info | 275 `(condition-case error-info |
276 (progn | 276 (progn |
277 (assert ,assertion) | 277 (assert ,assertion) |
278 (Print-Pass "%S" (quote ,(or description assertion))) | 278 (Print-Pass "%S" ,(or description `(quote ,assertion))) |
279 (incf passes)) | 279 (incf passes)) |
280 (cl-assertion-failed | 280 (cl-assertion-failed |
281 (Print-Failure (if ,failing-case | 281 (Print-Failure (if ,failing-case |
282 "Assertion failed: %S; failing case = %S" | 282 "Assertion failed: %S; failing case = %S" |
283 "Assertion failed: %S") | 283 "Assertion failed: %S") |
284 (quote ,(or description assertion)) ,failing-case) | 284 ,(or description `(quote ,assertion)) ,failing-case) |
285 (incf assertion-failures)) | 285 (incf assertion-failures)) |
286 (t (Print-Failure (if ,failing-case | 286 (t (Print-Failure (if ,failing-case |
287 "%S ==> error: %S; failing case = %S" | 287 "%S ==> error: %S; failing case = %S" |
288 "%S ==> error: %S") | 288 "%S ==> error: %S") |
289 (quote ,(or description assertion)) | 289 ,(or description `(quote ,assertion)) |
290 error-info ,failing-case) | 290 error-info ,failing-case) |
291 (incf other-failures) | 291 (incf other-failures) |
292 ))) | 292 ))) |
293 | 293 |
294 | 294 |