compatibility/collects/tests/racket/etc.rkt
Matthew Flatt a9c5ca02a2 move tests/mzscheme to tests/racket
original commit: 882b7dce0eaf92eab6fe45565ca6c1a09aa26027
2010-04-27 18:28:39 -06:00

54 lines
1.1 KiB
Racket

(load-relative "loadtest.rkt")
(Section 'etc)
(require mzlib/etc)
(let ()
(begin-with-definitions
(define-syntax (goo stx)
(syntax-case stx ()
[(_ foo) #'(define-syntax (foo stx) (syntax-case stx () [(_ x) #'(define x 12)]))]))
(goo foo)
(foo x)
(test 12 'bwd x)))
(let-syntax ([goo (lambda (stx) #'(begin (define z 13) (test 13 'bwd z)))])
(let-syntax ([y (lambda (stx) #'goo)])
(let ()
(begin-with-definitions
(define-syntax (goo stx)
(syntax-case stx ()
[(_ foo) #'(define-syntax (foo stx) (syntax-case stx () [(_ x) #'(define x 12)]))]))
(goo foo)
(foo x)
y
(test 12 'bwd x)))))
(let ()
(begin-with-definitions
(define-struct a (b c))
(test 2 'bwd (a-c (make-a 1 2)))))
(let ()
(begin-with-definitions
(define-struct a (b c))
(let ()
(define-struct (d a) (e))
(test 3 'bwd (d-e (make-d 1 2 3))))))
(let ()
(begin-with-definitions
(define-struct a (b c))
(define-struct (d a) (e))
(test 3 'bwd (d-e (make-d 1 2 3)))))
(syntax-test #'(begin-with-definitions
(define-syntax goo 10)
(define goo 10)
12))
(report-errs)