I am trying to get a macro working to generate an automatic testsuite. I
have shrank my example to:
(define-syntax (gen-testsuite stx)
(syntax-case stx ()
#,@(for/list ([i (syntax->datum #'n)])
(format "Test number ~a" i)
(check = i i))))]))
This should generate a test-suite that can then be wrapped in run-tests.
It should example to something like:
(test-case "Test number 1" (check = 1 1))
(test-case "Test number 2" (check = 2 2))
(test-case "Test number 3" (check = 3 3))
This fails because the i in the body of the test case does not exist at
run-time. I understand why this is failing. However if I try to replace
the i by #,(syntax->datum #'i) it also fails. My feeling is that I need
to introduce a new template variable, which I would generally do with
with-syntax however I am not sure how to integrate this with the
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.