;; statement language (module tests mzscheme (provide test-list) ;;;;;;;;;;;;;;;; tests ;;;;;;;;;;;;;;;; ;; Test cases have the following form: ;; (test-name program trace) ;; where ;; test-name := symbol ;; program::= string ;; trace ::= ERROR | (list-of (or bool number)) (define test-list '( (test1 "var x,y; {x = 3; y = 4; print -(y,x)}" (1)) (test2 "var x,y,z; {x = 3; y = 4; z = 0; while not(zero?(x)) {z = -(z,-(0,y)); x = -(x,1)}; print z}" (12)) (test3 " var x; {x = 3; print x; var x; {x = 4; print x}; print x}" (3 4 3)) (test4 "var f,x; {f = proc(x,y) -(x,y); x = 3; print (f 4 x)}" (1)) (block-stmt1 "var i,j; { i = 3 ; j = 4 ; print -(i,j); print -(j,i)}" (-1 1)) (block-test-2 "var i,j; { i = 3 ; j = 4 ; print -(p,j); print -(j,i)}" error) )) )