-
Notifications
You must be signed in to change notification settings - Fork 0
/
testPart1.rkt
29 lines (28 loc) · 886 Bytes
/
testPart1.rkt
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
(load "interpreter.scm")
(define test
(lambda (file expected)
(if (eq? (interpret file) expected) (string-append "Passed: " file) (string-append "Failed: " file))))
(test "Tests/1.txt" 150)
(test "Tests/2.txt" -4)
(test "Tests/3.txt" 10)
(test "Tests/4.txt" 16)
(test "Tests/5.txt" 220)
(test "Tests/6.txt" 5)
(test "Tests/7.txt" 6)
(test "Tests/8.txt" 10)
(test "Tests/9.txt" 5)
(test "Tests/10.txt" -39)
(with-handlers ([exn:fail? (lambda (exn) exn)])
(test "Tests/11.txt" 20))
(with-handlers ([exn:fail? (lambda (exn) exn)])
(test "Tests/12.txt" 20))
(with-handlers ([exn:fail? (lambda (exn) exn)])
(test "Tests/13.txt" 20))
(with-handlers ([exn:fail? (lambda (exn) exn)])
(test "Tests/14.txt" 20))
(test "Tests/15.txt" 'true)
(test "Tests/16.txt" 100)
(test "Tests/17.txt" 'false)
(test "Tests/18.txt" 'true)
(test "Tests/19.txt" 128)
(test "Tests/20.txt" 12)