diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/keyword-expansion-test.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/keyword-expansion-test.rkt index b2cd5388..e65ace85 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/keyword-expansion-test.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/keyword-expansion-test.rkt @@ -56,10 +56,6 @@ [t-opt (() ()) (-> result)] [t-opt ((one) ()) (-> one result)] - [t-opt (() (one)) - (cl->* - (-> one true result) - (-> false false result))] [t-opt ((one two three four) ()) (-> one two three four result)] [t-opt (() (one)) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/parse-type-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/parse-type-tests.rkt index 59806b32..833d83e7 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/parse-type-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/parse-type-tests.rkt @@ -77,7 +77,6 @@ [(pred Number) (make-pred-ty N)] [(-> (values Number Boolean Number)) (t:-> (-values (list N B N)))] [(Number -> Number) (t:-> N N)] - [(Number -> Number) (t:-> N N)] [(All (A) Number -> Number) (-poly (a) (t:-> N N))] [(All (A) (Number -> Number)) (-poly (a) (t:-> N N))] [(All (A) A -> A) (-poly (a) (t:-> a a))] @@ -112,8 +111,6 @@ [(Listof Number) (make-Listof N)] [a (-v a) (dict-set initial-tvar-env 'a (-v a))] - [(All (a ...) (a ... -> Number)) - (-polydots (a) ((list) [a a] . ->... . N))] [(Any -> Boolean : Number) (make-pred-ty -Number)] [(Any -> Boolean : #:+ (Number @ 0) #:- (! Number @ 0)) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/remove-intersect-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/remove-intersect-tests.rkt index 13659ebd..fe2da6ec 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/remove-intersect-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/remove-intersect-tests.rkt @@ -10,8 +10,8 @@ (define-syntax (over-tests stx) (syntax-case stx () [(_ [t1 t2 res] ...) - #'(test-suite "Tests for intersect" - (test-check (format "Overlap test: ~a ~a" 't1 't2) (lambda (a b) (eq? (not (not a)) b)) (overlap t1 t2) res) ...)])) + #'(test-suite "Tests for overlap" + (test-check (format "~a ~a" 't1 't2) (lambda (a b) (eq? (not (not a)) b)) (overlap t1 t2) res) ...)])) (define overlap-tests (over-tests @@ -20,8 +20,8 @@ (define-syntax (restr-tests stx) (syntax-case stx () [(_ [t1 t2 res] ...) - #'(test-suite "Tests for intersect" - (test-check (format "Restrict test: ~a ~a" 't1 't2) type-compare? (restrict t1 t2) res) ...)])) + #'(test-suite "Tests for restrict" + (test-check (format "~a ~a" 't1 't2) type-compare? (restrict t1 t2) res) ...)])) (define restrict-tests @@ -50,7 +50,7 @@ [(_ [t1 t2 res] ...) (syntax/loc stx (test-suite "Tests for remove" - (test-check (format "Remove test: ~a ~a" 't1 't2) type-compare? (remove t1 t2) res) ...))])) + (test-check (format "~a ~a" 't1 't2) type-compare? (remove t1 t2) res) ...))])) (define remove-tests (remo-tests diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/special-env-typecheck-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/special-env-typecheck-tests.rkt index 4af3e861..200b1add 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/special-env-typecheck-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/special-env-typecheck-tests.rkt @@ -31,7 +31,7 @@ (define-syntax (tc-e stx) (syntax-parse stx - [(_ expr ty) (syntax/loc stx (tc-e expr #:ret (ret ty)))] + [(tc-e expr ty) (syntax/loc stx (tc-e expr #:ret (ret ty)))] [(id a #:ret b) (syntax/loc stx (test-case (format "~a ~a" (quote-line-number id) 'a) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/subst-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/subst-tests.rkt index 944dab22..85d65d60 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/subst-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/subst-tests.rkt @@ -8,10 +8,10 @@ (gen-test-main) (define-syntax-rule (s img var tgt result) - (test-eq? "test" (substitute img 'var tgt) result)) + (test-eq? (format "~a" '(img tgt)) (substitute img 'var tgt) result)) (define-syntax-rule (s... imgs var tgt result) - (test-eq? "test" (substitute-dots (list . imgs) #f 'var tgt) result)) + (test-eq? (format "~a" '(img tgt)) (substitute-dots (list . imgs) #f 'var tgt) result)) (define tests (test-suite "Tests for substitution" diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/type-equal-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/type-equal-tests.rkt index 9485b79f..26fff4ef 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/type-equal-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/type-equal-tests.rkt @@ -14,16 +14,13 @@ (define-syntax (te-tests stx) (define (single-test stx) (syntax-case stx (FAIL) - [(FAIL t s) #'((test-check (format "FAIL ~a" '(t s)) (lambda (a b) (not (type-equal? a b))) t s) - (test-check (format "FAIL ~a" '(s t)) (lambda (a b) (not (type-equal? a b))) s t))] - [(t s) (syntax/loc stx - ((test-check (format "~a" '(t s)) type-equal? t s) - (test-check (format "~a" '(s t)) type-equal? s t)))])) + [(FAIL t s) (syntax/loc stx (test-check (format "FAIL ~a" '(t s)) + (lambda (a b) (not (type-equal? a b))) t s))] + [(t s) (syntax/loc stx (test-check (format "~a" '(t s)) type-equal? t s))])) (syntax-case stx () [(_ cl ...) - (with-syntax ([((cl1 cl2) ...) (map single-test (syntax->list #'(cl ...)))]) - #'(test-suite "Tests for type equality" - cl1 ... cl2 ...))])) + #`(test-suite "Tests for type equality" + #,@(map single-test (syntax->list #'(cl ...))))])) (define (fld* t) (make-fld t (datum->syntax #'here 'values) #f)) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt index edba94dc..1e8c1523 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt @@ -56,6 +56,7 @@ (require "evaluator.rkt" "test-utils.rkt" + syntax/location (for-syntax racket/base syntax/parse @@ -80,14 +81,14 @@ (pattern (~seq) #:attr v #'#f)) - (define (check-no-error stx body) + (define (test-no-error stx name body) (quasisyntax/loc stx - (check-not-exn + (test-not-exn (format "~a ~a" (quote-line-number #,name) '#,name) (lambda () #,body)))) - (define (check-syntax-error stx body) + (define (test-syntax-error stx name body) (quasisyntax/loc stx - (check-exn + (test-exn (format "~a ~a" (quote-line-number #,name) '#,name) exn:fail:syntax? (lambda () #,body))))) @@ -96,10 +97,10 @@ (define-syntax (tc-e stx) (syntax-parse stx [(_ code:expr #:proc p) - (check-no-error stx + (test-no-error stx #'code #'(phase1-eval (test/proc (quote-syntax code) p)))] [(_ code:expr return:return x:expected) - (check-no-error stx + (test-no-error stx #'code #'(phase1-eval (test (quote-syntax code) return.v x.v)))])) (define-syntax (tc-e/t stx) @@ -110,7 +111,7 @@ (define-syntax (tc-l stx) (syntax-parse stx [(_ lit ty exp:expected) - (check-no-error stx + (test-no-error stx (syntax/loc #'lit (LITERAL lit)) #'(phase1-eval (test-literal #'lit ty exp.v)))])) @@ -118,13 +119,13 @@ (define-syntax (tc-err stx) (syntax-parse stx [(_ code:expr ex:expected) - (check-syntax-error stx + (test-syntax-error stx (syntax/loc #'code (FAIL code)) #'(phase1-eval (tc (tr-expand (quote-syntax code)) ex.v)))])) (define-syntax (tc-l/err stx) (syntax-parse stx [(_ lit:expr ex:expected) - (check-syntax-error stx + (test-syntax-error stx #'(syntax/loc #'lit (LITERAL/FAIL lit)) #'(phase1-eval (tc-literal #'lit ex.v)))]))