learning-sicp

My embarrassing half assed SICP run.
git clone https://kaka.farm/~git/learning-sicp
Log | Files | Refs

exercise-11.scm (1063B)


      1 (define-library (sicp tests chapter-4 exercise-11)
      2   (import (scheme base)
      3 
      4           (srfi :64)
      5 
      6           (sicp solutions chapter-4 exercise-11)
      7 
      8           (sicp utils))
      9 
     10   (begin
     11     (debug! #t)
     12 
     13     (test-begin "chapter-4-exercise-11")
     14 
     15     (test-equal 1
     16          (eval '1
     17                (setup-environment)))
     18 
     19     (test-equal 1
     20       (eval '(begin
     21                (define a 1)
     22                1)
     23             (setup-environment)))
     24 
     25     (test-equal 1
     26       (eval '(begin
     27                (define a 1)
     28                (let ((b 1))
     29                  b))
     30             (setup-environment)))
     31 
     32     (test-equal 1
     33       (eval '(begin
     34                (define a 1)
     35                (let* ((b 1))
     36                  b))
     37             (setup-environment)))
     38 
     39     (test-equal 2
     40       (eval '(begin
     41                (define a 1)
     42                (+ a 1))
     43             (setup-environment)))
     44 
     45     (test-equal 3
     46       (eval '(begin
     47                (define a 1)
     48                (let ((b (+ a 1)))
     49                  (+ a b)))
     50             (setup-environment)))
     51 
     52     (test-end "chapter-4-exercise-11")))