VeryLightSchemeUnit

A very light SchemeUnit indeed

The “engine”, some code and some tests:

(define (assert-equals expected actual)
  (if (= expected actual)
      (display ".")
      (display ".F")))

(define (add x y)
  (+ x y))

(define (test-add-ok)
  (assert-equals 5 (add 2 3)))

(define (test-add-ko)
  (assert-equals 4 (add 2 3)))

(define (test-suite)
   (test-add-ok)
   (test-add-ko)
)

Run the suite

> (test-suite)
..F
>

Other features badly needed

- Display the name of the failing test
- Print a message when a test fails, something like “expected foo but got goo”
- Test count

Leave a Comment