Skip to content

Commit

Permalink
add another unit test for dynamic scope
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Feb 9, 2024
1 parent f8cdb14 commit 70236b5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/dynamic.scm
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,21 @@
(stak-aux))))
(stak 18 12 6)))
7)))

(test "dynamic: close?"
(lambda (t)
(t.is (exec (begin

(define (small? delta)
(close? delta 0))

(define delta 10e-10)

(define (dist x y)
(sqrt (+ (expt x 2) (expt y 2))))

(define (close? x y)
(<= (dist x y) delta))

(small? 1000000)))
#t)))

0 comments on commit 70236b5

Please sign in to comment.