exercise-6.scm (855B)
1 (define-library (sicp tests chapter-4 exercise-6) 2 (import (scheme base) 3 4 (srfi :64) 5 6 (sicp solutions chapter-4 exercise-6)) 7 8 (begin 9 (test-begin "chapter-4-exercise-6") 10 11 (test-equal 1 12 (eval '(cond 13 (else 1)) 14 (setup-environment))) 15 16 (test-equal 1 17 (eval '(cond 18 (true 1) 19 (else 2)) 20 (setup-environment))) 21 22 (test-equal 2 23 (eval '(cond 24 (false 1) 25 (else 2)) 26 (setup-environment))) 27 28 (test-equal 5 29 (eval '(cond 30 (false 1) 31 ((+ 2 3) => (lambda (x) 32 (let ((y -6) 33 (z 6)) 34 (+ x y z)))) 35 (else 2)) 36 (setup-environment))) 37 38 (test-end "chapter-4-exercise-6")))