Hello,

I'm trying to implement a procedure that takes a test-runner object and returns a string with information about the most recently run test. For example, calling

(format-test-result (make-runner #:test-name "A is not B." #:result-kind 'fail))

is expected to return:

  ✖ FAIL A is not B.

In the example, `make-runner` is a procedure that is supposed to create a test-runner stub with the given values, so that I can test the `format-test-result` procedure.

I thought I could define `make-runner` body like this:

  (let ((runner-stub (test-runner-null)))
    (test-runner-test-name! runner-stub test-name)
    (test-result-set! runner-stub 'result-kind result-kind)
    stub-runner))

The problem is, the `test-runner-test-name!` setter does not exist. And test-runner objects don't seem to have a `test-name` slot. They do provide a `test-runner-test-name` getter, though.

So I don't know how to create a test-runner stub to test my procedure.

What would you do in this case?


--
Luis Felipe López Acevedo
http://sirgazil.bitbucket.io/



Reply via email to