Tests added to the repository.
[picobit/chj.git] / tests / arithmetic / sub.scm
blob05749a710633ece7c71499d0e99af3796a71e55f
1 (define-macro (test-cond condition name) ;; TODO watch out for name capture
2   `(let ((DUMMY-x ,condition))
3      (display ,name)
4      (if DUMMY-x
5        (display " : PASSED\n")
6        (begin (display " : FAILED, got : ")
7               (display DUMMY-x)
8               (display "\n")))))
10 (test-cond (= (- 2 2) 0) "2 - 2 = 0")
11 (test-cond (= (- 5 3) 2) "5 - 3 = 0")
12 (test-cond (= (- 5 7) -2) "5 - 7 = -2")
13 (test-cond (= (- 4 0) 4) "4 - 0 = 4")
14 (test-cond (= (- 0 4) -4) "0 - 4 = -4")
15 (test-cond (= (- 2 -2) 4) "2 - -2 = 4")
16 (test-cond (= (- -2 -5) 3) "-2 - -5 = 3")
17 (test-cond (= (- -5 -2) -3) "-5 - -2 = -3")