I am creating a rack test suite, where are the actual test-case and check-equal? the function is defined in the macro. The code looks something like this:
#lang racket (require rackunit rackunit/text-ui) (define-syntax (my-test=? stx) (syntax-case stx () [(_ case1 case2) (syntax/loc stx (test-case "tests" (check-equal? case1 case2)))])) (define tests (test-suite "tests" (my-test=? 'a 'b))) (run-tests tests)
However, when I run this code, I get the following output:
-------------------- tests > tests tests FAILURE name: check-equal? location: unsaved-editor:11:9 actual: 'a expected: 'b . Check failure -------------------- 0 success(es) 1 failure(s) 0 error(s) 1 test(s) run
If line 11 is a check-equal? function line check-equal? inside the macro: (check-equal? case1 case2)))]))
Is there a way that I can show an error in a line where my-test=? : (my-test=? 'a 'b))) ?
macros racket rackunit
Leif andersen
source share