-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests-3.5.ss
39 lines (37 loc) · 981 Bytes
/
tests-3.5.ss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#lang scheme
(require "helper.ss")
(add-tests-with-string-output "let"
[($let ([x 5]) x) => "5"]
[($let ([x ($+ 1 2)]) x) => "3"]
[($let ([x ($+ 1 2)])
($let ([y ($+ 3 4)])
($+ x y)))
=> "10"]
[($let ([x ($+ 1 2)])
($let ([y ($+ 3 4)])
($- y x)))
=> "4"]
[($let ([x ($+ 1 2)]
[y ($+ 3 4)])
($- y x))
=> "4"]
[($let ([x ($let ([y ($+ 1 2)]) ($* y y))])
($+ x x))
=> "18"]
[($let ([x ($+ 1 2)])
($let ([x ($+ 3 4)])
x))
=> "7"]
[($let ([x ($+ 1 2)])
($let ([x ($+ x 4)])
x))
=> "7"]
[($let ([t ($let ([t ($let ([t ($let ([t ($+ 1 2)]) t)]) t)]) t)]) t)
=> "3"]
[($let ([x 12])
($let ([x ($+ x x)])
($let ([x ($+ x x)])
($let ([x ($+ x x)])
($+ x x)))))
=> "192"]
)