I am building a set of rackunit tests, where the actual test-case
and check-equal?
function is defined in a 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
Where line 11 is the line of the check-equal?
function inside of the macro: (check-equal? case1 case2)))]))
Is there any way I can rackunit to show the error on the line where my-test=?
is used: (my-test=? 'a 'b)))
?