From 61a2a93e40859cfbd6457f02c9d7bf57e7b7c83c Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Mon, 11 Mar 2013 22:53:29 -0700 Subject: [PATCH] Add checks for failing to parse types. original commit: 4683be8793bdbd3e16e62dfbdd5d2be54cce9c05 --- .../typed-racket/unit-tests/parse-type-tests.rkt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/collects/tests/typed-racket/unit-tests/parse-type-tests.rkt b/collects/tests/typed-racket/unit-tests/parse-type-tests.rkt index adedbe14..5aa93f7a 100644 --- a/collects/tests/typed-racket/unit-tests/parse-type-tests.rkt +++ b/collects/tests/typed-racket/unit-tests/parse-type-tests.rkt @@ -43,7 +43,16 @@ (parse-type (syntax ty))))])) (define-syntax (pt-test stx) - (syntax-case stx () + (syntax-case stx (FAIL) + [(_ FAIL ty-stx) + (syntax/loc stx (pt-test FAIL ty-stx initial-tvar-env))] + [(_ FAIL ty-stx tvar-env) + (quasisyntax/loc stx + (test-exn #,(format "~a" (syntax->datum #'ty-stx)) + exn:fail:syntax? + (parameterize ([current-tvars tvar-env] + [delay-errors? #f]) + (lambda () (parse-type (quote-syntax ty-stx))))))] [(_ ts tv) (syntax/loc stx (pt-test ts tv initial-tvar-env))] [(_ ty-stx ty-val tvar-env) (quasisyntax/loc @@ -66,6 +75,9 @@ (define (parse-type-tests) (pt-tests "parse-type tests" + [FAIL UNBOUND] + [FAIL List] + [FAIL (All (A) (List -> Boolean))] [Number N] [Any Univ] [(List Number String) (-Tuple (list N -String))]