add stlc fail tests

This commit is contained in:
Stephen Chang 2015-10-22 13:22:35 -04:00
parent b4bc922dda
commit f7635af9b5

View File

@ -1,4 +1,12 @@
#lang s-exp "../stlc.rkt"
(require "rackunit-typechecking.rkt")
;; cannot write any terms without base types
;; cannot write any terms without base types, but can check some errors
(typecheck-fail (λ ([x : Undef]) x) #:with-msg "Undef: unbound identifier")
(typecheck-fail (λ ([x : ]) x)
#:with-msg "Improper usage of type constructor →.+expected >= 1 arguments")
(typecheck-fail (λ ([x : ()]) x)
#:with-msg "Improper usage of type constructor →.+expected >= 1 arguments")
(typecheck-fail (λ ([x : ( )]) x)
#:with-msg "Improper usage of type constructor →.+expected >= 1 arguments")