-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtesting.scm
More file actions
27 lines (24 loc) · 835 Bytes
/
testing.scm
File metadata and controls
27 lines (24 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(print "Rustle test suite")
;(define cur-section '())(define errs '())
;(define SECTION (lambda args
; (display "SECTION") (print args)
; (set! cur-section args) #t))
;(define record-error (lambda (e) (set! errs (cons (list cur-section e) errs))))
(define test
(lambda (expect result)
(if (not (equal? expect result))
((lambda ()
(display "ERR ") (display expect) (display " --> ") (print result)
#f))
((lambda ()
(display " ") (display expect) (display " --> ") (print result)
#t)))))
;(define report-errs
; (lambda ()
; (display "")
; (if (null? errs) (display "Passed all tests")
; ((lambda ()
; (print "errors were:")
; (print "(SECTION (got expected (call)))")
; (map print errs))))
; (display "")))