[uim-commit] r2047 - branches/r5rs/sigscheme/test
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Nov 7 01:33:05 PST 2005
Author: yamaken
Date: 2005-11-07 01:32:50 -0800 (Mon, 07 Nov 2005)
New Revision: 2047
Modified:
branches/r5rs/sigscheme/test/unittest.scm
Log:
* sigscheme/test/unittest.scm
- (assert, assert-false, assert-eq?, assert-equal?, assert-error):
Rename arguments
Modified: branches/r5rs/sigscheme/test/unittest.scm
===================================================================
--- branches/r5rs/sigscheme/test/unittest.scm 2005-11-07 09:27:04 UTC (rev 2046)
+++ branches/r5rs/sigscheme/test/unittest.scm 2005-11-07 09:32:50 UTC (rev 2047)
@@ -76,42 +76,50 @@
(newline)))
(define assert
- (lambda (msg exp)
+ (lambda (test-name exp)
(set! *total-assertions* (+ *total-assertions* 1))
(if exp
#t
(begin
(set! *total-failures* (+ *total-failures* 1))
- (report-error msg)
+ (report-error test-name)
#f))))
+;;
+;; assertions for test writers
+;;
+
(define assert-true assert)
(define assert-false
- (lambda (msg exp)
- (assert msg (not exp))))
+ (lambda (test-name exp)
+ (assert test-name (not exp))))
(define assert-eq?
- (lambda (msg a b)
- (or (assert msg (eq? a b))
- (report-inequality a b))))
+ (lambda (test-name expected actual)
+ (or (assert test-name (eq? expected actual))
+ (report-inequality expected actual))))
(define assert-equal?
- (lambda (msg a b)
- (or (assert msg (equal? a b))
- (report-inequality a b))))
+ (lambda (test-name expected actual)
+ (or (assert test-name (equal? expected actual))
+ (report-inequality expected actual))))
(define assert-error
- (lambda (assertion-name proc)
+ (lambda (test-name proc)
(let ((errored (guard (err
(else
#t))
(proc)
#f))
- (err-msg (string-append "no error has occurred in assertion "
- assertion-name)))
+ (err-msg (string-append "no error has occurred in test "
+ test-name)))
(assert err-msg errored))))
+;;
+;; misc
+;;
+
(define (eval-counter n)
(list 'eval-counter (+ n 1)))
More information about the uim-commit
mailing list