[uim-commit] r2046 - branches/r5rs/sigscheme/test
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Nov 7 01:27:29 PST 2005
Author: yamaken
Date: 2005-11-07 01:27:04 -0800 (Mon, 07 Nov 2005)
New Revision: 2046
Modified:
branches/r5rs/sigscheme/test/unittest.scm
Log:
* sigscheme/test/unittest.scm
- (report-inequality): New procedure
- (assert-eq?, assert-equal?):
* Change message format and simplify with report-inequality
* Remove "assert-eq?" and "assert-equal?" from error message since
such detail is useless for test writers
Modified: branches/r5rs/sigscheme/test/unittest.scm
===================================================================
--- branches/r5rs/sigscheme/test/unittest.scm 2005-11-07 09:02:49 UTC (rev 2045)
+++ branches/r5rs/sigscheme/test/unittest.scm 2005-11-07 09:27:04 UTC (rev 2046)
@@ -64,6 +64,17 @@
(display errmsg)
(newline))))
+(define report-inequality
+ (lambda (expected actual)
+ (display " expected: <")
+ (write expected)
+ (display ">")
+ (newline)
+ (display " actual: <")
+ (write actual)
+ (display ">")
+ (newline)))
+
(define assert
(lambda (msg exp)
(set! *total-assertions* (+ *total-assertions* 1))
@@ -82,23 +93,13 @@
(define assert-eq?
(lambda (msg a b)
- (if (not (assert msg (eq? a b)))
- (begin
- (display "assert-eq? : we expect ")
- (write a)
- (display " but got ")
- (write b)
- (newline)))))
+ (or (assert msg (eq? a b))
+ (report-inequality a b))))
(define assert-equal?
(lambda (msg a b)
- (if (not (assert msg (equal? a b)))
- (begin
- (display "assert-equal? : we expect ")
- (write a)
- (display " but got ")
- (write b)
- (newline)))))
+ (or (assert msg (equal? a b))
+ (report-inequality a b))))
(define assert-error
(lambda (assertion-name proc)
More information about the uim-commit
mailing list