add missing test case

Add test case intended to be part of a3fcaf92df.
This commit is contained in:
Matthew Flatt 2019-04-30 09:31:51 -06:00
parent a3fcaf92df
commit 6a0bbc301e

View File

@ -2300,6 +2300,29 @@
(test #t 'has-binding-match? (for/or ([b (in-list binds)])
(free-identifier=? r b)))))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Check that `define/public` doesn't add a dye pack unnecessarily
(define-syntax (change-five-to-six stx)
(syntax-case stx ()
[(_ e)
(let loop ([e (local-expand #'e (syntax-local-context) (list #'begin #'define))])
(syntax-case e (begin)
[(begin . e)
#`(begin #,@(map loop (syntax->list #'e)))]
[(define id rhs)
#`(define id #,(loop #'rhs))]
[5 #'6]
[_ e]))]))
(let ()
(define-local-member-name x y)
(test 6 values (send (new (class object%
(change-five-to-six
(define/public (x) 5))
(super-new)))
x)))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(report-errs)