commit 6e9b920477e34b2e81d319472d25d6c0ab3e9881
parent 30bf1aaa2d1a4cbce139fc04d7aae926cef2ea2d
Author: Georges Dupéron <georges.duperon@gmail.com>
Date: Fri, 5 May 2017 22:00:30 +0200
Removed compile-time debugging display, transformed it into a test.
Diffstat:
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/private/find-defined-pvars.rkt b/private/find-defined-pvars.rkt
@@ -11,6 +11,8 @@
(require stxparse-info/current-pvars
(for-syntax racket/list))
+(define result #f)
+
(define-syntax (continue stx)
(syntax-case stx ()
[(_ old-pvars-stx)
@@ -26,13 +28,11 @@
" Before: ~a\n"
" After: ~a\n"
" New items: ~a"
- old-pvars
- rest-pvars
- new-pvars)))
-
- (displayln old-pvars)
- (displayln new-pvars)
- #'(begin))]))
+ old-pvars
+ rest-pvars
+ new-pvars)))
+ ;; Return the result for tests:
+ #`(set! result '#,new-pvars))]))
(define-syntax (find-defined-pvars stx)
(syntax-case stx ()
@@ -43,4 +43,8 @@
(define/with-syntax (a . b) #'(1 2))
(find-defined-pvars (x . y) #'(3 4))
-(define/with-syntax (c . d) #'(5 6))
-\ No newline at end of file
+(define/with-syntax (c . d) #'(5 6))
+
+(module+ test
+ (require rackunit)
+ (check-equal? result '(y x)))
+\ No newline at end of file