fix check-expect-maker contract, reorganize code
svn: r13157
This commit is contained in:
parent
76657082d9
commit
822a536b7f
|
@ -49,32 +49,37 @@
|
||||||
;; (make-expected-error src string scheme-val)
|
;; (make-expected-error src string scheme-val)
|
||||||
(define-struct (expected-error check-fail) (message value))
|
(define-struct (expected-error check-fail) (message value))
|
||||||
|
|
||||||
;; check-expect-maker : syntax? syntax? (listof syntax?) -> syntax?
|
;; check-expect-maker : syntax? syntax? (listof syntax?) symbol? -> syntax?
|
||||||
;; the common part of all three test forms.
|
;; the common part of all three test forms.
|
||||||
(define-for-syntax (check-expect-maker stx checker-proc-stx embedded-stxes hint-tag)
|
(define-for-syntax (check-expect-maker stx checker-proc-stx embedded-stxes
|
||||||
(with-syntax ([bogus-name (stepper-syntax-property #`#,(gensym 'test) 'stepper-hide-completed #t)]
|
hint-tag)
|
||||||
[src-info (with-stepper-syntax-properties (['stepper-skip-completely #t])
|
(define bogus-name
|
||||||
|
(stepper-syntax-property #`#,(gensym 'test) 'stepper-hide-completed #t))
|
||||||
|
(define src-info
|
||||||
|
(with-stepper-syntax-properties (['stepper-skip-completely #t])
|
||||||
#`(list #,@(list #`(quote #,(syntax-source stx))
|
#`(list #,@(list #`(quote #,(syntax-source stx))
|
||||||
(syntax-line stx)
|
(syntax-line stx)
|
||||||
(syntax-column stx)
|
(syntax-column stx)
|
||||||
(syntax-position stx)
|
(syntax-position stx)
|
||||||
(syntax-span stx))))])
|
(syntax-span stx)))))
|
||||||
(quasisyntax/loc stx
|
(quasisyntax/loc stx
|
||||||
(define bogus-name
|
(define #,bogus-name
|
||||||
#,(stepper-syntax-property
|
#,(stepper-syntax-property
|
||||||
#`(let ([test-info (namespace-variable-value
|
#`(let ([test-info (namespace-variable-value
|
||||||
'test~object #f builder (current-namespace))])
|
'test~object #f builder (current-namespace))])
|
||||||
(when test-info
|
(when test-info
|
||||||
(insert-test test-info
|
(insert-test test-info
|
||||||
(lambda ()
|
(lambda ()
|
||||||
#,(with-stepper-syntax-properties (['stepper-hint hint-tag]
|
#,(with-stepper-syntax-properties
|
||||||
|
(['stepper-hint hint-tag]
|
||||||
['stepper-hide-reduction #t]
|
['stepper-hide-reduction #t]
|
||||||
['stepper-use-val-as-final #t])
|
['stepper-use-val-as-final #t])
|
||||||
(quasisyntax/loc stx
|
(quasisyntax/loc stx
|
||||||
(#,checker-proc-stx
|
(#,checker-proc-stx
|
||||||
#,@embedded-stxes
|
#,@embedded-stxes
|
||||||
src-info
|
#,src-info
|
||||||
#,(with-stepper-syntax-properties (['stepper-no-lifting-info #t]
|
#,(with-stepper-syntax-properties
|
||||||
|
(['stepper-no-lifting-info #t]
|
||||||
['stepper-hide-reduction #t])
|
['stepper-hide-reduction #t])
|
||||||
#'test-info))))))))
|
#'test-info))))))))
|
||||||
'stepper-skipto
|
'stepper-skipto
|
||||||
|
@ -82,7 +87,7 @@
|
||||||
skipto/third skipto/second ;; unless (it expands into a begin)
|
skipto/third skipto/second ;; unless (it expands into a begin)
|
||||||
skipto/cdr skipto/third ;; application of insert-test
|
skipto/cdr skipto/third ;; application of insert-test
|
||||||
'(syntax-e cdr cdr syntax-e car) ;; lambda
|
'(syntax-e cdr cdr syntax-e car) ;; lambda
|
||||||
))))))
|
)))))
|
||||||
|
|
||||||
(define-for-syntax (check-context?)
|
(define-for-syntax (check-context?)
|
||||||
(let ([c (syntax-local-context)])
|
(let ([c (syntax-local-context)])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user