Add complete test coverage for 2.rkt
This commit is contained in:
12
Final/2.rkt
12
Final/2.rkt
@ -288,4 +288,14 @@
|
||||
{lam {fX}
|
||||
{body-proc {lam {x} {{fX fX} x}}}}}}})
|
||||
|
||||
(test (run fact-prog) (numV 120)))
|
||||
(test (run fact-prog) (numV 120)))
|
||||
|
||||
; stupid tests for coverage
|
||||
(module+ test
|
||||
(test/exn (parse-error 'invalid-syntax) "invalid-syntax")
|
||||
(test (parse `(error "test error")) (errorE "test error"))
|
||||
(test/exn (parse `(error 123)) "parse error")
|
||||
(test/exn (parse `(unknown 1 2 3)) "parse error")
|
||||
(test/exn (arith-op + (numV 1) (errorV "not a number")) "expects a number")
|
||||
(test/exn (parse `#f) "parse error"))
|
||||
|
Reference in New Issue
Block a user