Remove unecessary lambda wrapper around test suites.

original commit: df892c9439b9dc367d6793aabde97c50dd24a92b
This commit is contained in:
Eric Dobson 2013-10-08 21:54:27 -07:00
parent c15c31d8bf
commit 09d380fdbf
12 changed files with 29 additions and 39 deletions

View File

@ -17,35 +17,27 @@
"interactive-tests.rkt"
racket/runtime-path
rackunit rackunit/text-ui)
rackunit)
(provide unit-tests)
(define-runtime-path special "special-env-typecheck-tests.rkt")
(define unit-tests
(make-test-suite
"Unit Tests"
(for/list ([f (list
typecheck-tests
subtype-tests
type-equal-tests
restrict-tests
remove-tests
overlap-tests
parse-type-tests
type-annotation-tests
fv-tests
contract-tests
keyword-tests
interactive-tests
;; this uses dynamic require because the file fails to compile when there's a test failure
(λ () ((dynamic-require special 'typecheck-special-tests))))])
(f))))
(define go (lambda () unit-tests))
(list
;; this uses dynamic require because the file fails to compile when there's a test failure
(dynamic-require special 'typecheck-special-tests)
typecheck-tests
subtype-tests
type-equal-tests
restrict-tests
remove-tests
overlap-tests
parse-type-tests
type-annotation-tests
fv-tests
contract-tests
keyword-tests
interactive-tests)))

View File

@ -48,7 +48,7 @@
(define (contract-tests)
(define contract-tests
(test-suite "Contract Tests"
known-bugs
(t (-Number . -> . -Number))

View File

@ -13,7 +13,7 @@
(fv ty*)
(list (quote elems) ...))))
(define (fv-tests)
(define fv-tests
(test-suite "Tests for fv"
(fv-t -Number)
[fv-t (-v a) a]

View File

@ -42,7 +42,7 @@
,(syntax->datum #'form)) (force promised-ns)))))))]))
;; Add 'only at the toplevel tests'
(define (interactive-tests)
(define interactive-tests
(test-suite "Interactive tests"
(test-form #rx""

View File

@ -37,7 +37,7 @@
(define three (-val 'three))
(define four (-val 'four))
(define (keyword-tests)
(define keyword-tests
(test-suite "Tests for keyword expansion"
[t (-> result) (-> result)]

View File

@ -73,7 +73,7 @@
(define B -Boolean)
(define Sym -Symbol)
(define (parse-type-tests)
(define parse-type-tests
(pt-tests
"parse-type tests"
[FAIL UNBOUND]

View File

@ -11,7 +11,7 @@
#'(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) ...)]))
(define (overlap-tests)
(define overlap-tests
(over-tests
[-Number -Integer #t]))
@ -22,7 +22,7 @@
(test-check (format "Restrict test: ~a ~a" t1 t2) type-compare? (restrict t1 t2) res) ...)]))
(define (restrict-tests)
(define restrict-tests
(restr-tests
[-Number (Un -Number -Symbol) -Number]
[-Number -Number -Number]
@ -50,7 +50,7 @@
(test-suite "Tests for remove"
(test-check (format "Remove test: ~a ~a" t1 t2) type-compare? (remove t1 t2) res) ...))]))
(define (remove-tests)
(define remove-tests
(remo-tests
[(Un -Number -Symbol) -Number -Symbol]
[-Number -Number (Un)]

View File

@ -37,7 +37,7 @@
(tc-expr ex))
#,(syntax-local-eval #'b)))]))
(define (typecheck-special-tests)
(define typecheck-special-tests
(test-suite
"Special Typechecker tests"
;; should work but don't -- need expected type
@ -136,5 +136,3 @@
[tc-e (in-values*-sequence '(a b c))
(-seq (one-of/c 'a 'b 'c))]
))

View File

@ -11,7 +11,7 @@
(define-syntax-rule (s... imgs var tgt result)
(test-eq? "test" (substitute-dots (list . imgs) #f 'var tgt) result))
(define (subst-tests)
(define subst-tests
(test-suite "Tests for substitution"
(s -Number a (-v a) -Number)
(s... (-Number -Boolean) a (make-Function (list (make-arr-dots null -Number (-v a) 'a))) (-Number -Boolean . -> . -Number))

View File

@ -26,7 +26,7 @@
(define t1 (-mu T (-lst (Un (-v a) T))))
(define t2 (unfold t1))
(define (subtype-tests)
(define subtype-tests
(subtyping-tests
;; trivial examples
(Univ Univ)

View File

@ -26,7 +26,7 @@
(define (fld* t) (make-fld t (datum->syntax #'here 'values) #f))
(define (type-equal-tests)
(define type-equal-tests
(te-tests
[-Number -Number]
[(Un -Number) -Number]

View File

@ -191,7 +191,7 @@
(make-Path p var))))
(define (typecheck-tests)
(define typecheck-tests
(test-suite
"Typechecker tests"
#reader typed-racket/typed-reader