fix inlined (chibi test) lite

This commit is contained in:
Alex Shinn 2020-09-01 10:59:25 +09:00
parent 217baeeb57
commit f6bd8b6266
2 changed files with 42 additions and 6 deletions

View file

@ -5,9 +5,25 @@
(cond-expand
(chibi (import (chibi test)))
(else
;; avoid cyclic test deps in snow
(import (srfi 64))
(begin (define test test-equal))))
;; inline (chibi test) to avoid circular dependencies in snow
;; installations
(define-syntax test
(syntax-rules ()
((test expect expr)
(test 'expr expect expr))
((test name expect expr)
(guard (exn (else (display "!\nERROR: ") (write name) (newline)
(write exn) (newline)))
(let* ((res expr)
(pass? (equal? expect expr)))
(display (if pass? "." "x"))
(cond
((not pass?)
(display "\nFAIL: ") (write name) (newline))))))))
(define (test-begin name)
(display name))
(define (test-end)
(newline))))
(begin
(define (run-tests)
(test-begin "diff")

View file

@ -4,9 +4,29 @@
(cond-expand
(chibi (import (chibi test)))
(else
;; avoid cyclic test deps in snow
(import (srfi 64))
(begin (define test test-equal))))
;; inline (chibi test) to avoid circular dependencies in snow
;; installations
(define-syntax test
(syntax-rules ()
((test expect expr)
(test 'expr expect expr))
((test name expect expr)
(guard (exn (else (display "!\nERROR: ") (write name) (newline)
(write exn) (newline)))
(let* ((res expr)
(pass? (equal? expect expr)))
(display (if pass? "." "x"))
(cond
((not pass?)
(display "\nFAIL: ") (write name) (newline))))))))
(define-syntax test-error
(syntax-rules ()
((test-error expr)
(test-assert (guard (exn (else #t)) expr #f)))))
(define (test-begin name)
(display name))
(define (test-end)
(newline))))
(export run-tests)
(begin
(define (run-tests)