Tests defined-checks directly
This commit is contained in:
parent
c25c0b2868
commit
ecdd50da09
24
collects/redex/tests/defined-checks-test.rkt
Normal file
24
collects/redex/tests/defined-checks-test.rkt
Normal 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)
|
|
@ -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))
|
|
@ -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") '())
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user