Tests defined-checks directly

This commit is contained in:
Casey Klein 2011-08-30 13:07:13 -05:00
parent c25c0b2868
commit ecdd50da09
4 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#lang racket
(require "test-util.rkt"
"../private/error.rkt"
"../private/defined-checks.rkt")
(reset-count)
(define expected-message "reference to thing x before its definition")
(test (with-handlers ([exn:fail:redex? exn-message])
(check-defined-lexical x 'x "thing")
(define x 4)
"")
expected-message)
(test (with-handlers ([exn:fail:redex? exn-message])
(check-defined-module (λ () x) 'x "thing")
"")
expected-message)
(define x 4)
(print-tests-passed 'defined-checks-test.rkt)

View File

@ -0,0 +1,8 @@
("reference to metafunction q before its definition"
([use q]) ([def q])
(let ()
(term (use))
(define-language L)
(define-metafunction L
[(def) ()])
#f))

View File

@ -26,6 +26,7 @@
"pict-test.rkt"
"hole-test.rkt"
"stepper-test.rkt"
"defined-checks-test.rkt"
"check-syntax-test.rkt"
"test-docs-complete.rkt")
(if test-bitmaps? '("bitmap-test.rkt") '())

View File

@ -977,6 +977,10 @@
x)
'(2 1)))
(parameterize ([current-namespace (make-base-namespace)])
(eval '(require redex/reduction-semantics))
(exec-runtime-error-tests "run-err-tests/judgment-form-undefined.rktd"))
;; errors for not-yet-defined metafunctions
(test (parameterize ([current-namespace (make-empty-namespace)])
(namespace-attach-module (namespace-anchor->namespace this-namespace) 'redex/reduction-semantics)