unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* SRFI 64: How do I create a test-runner stub
@ 2019-03-07 21:02 sirgazil
  2019-03-07 23:40 ` Christopher Lam
  2019-03-09 19:58 ` sirgazil
  0 siblings, 2 replies; 4+ messages in thread
From: sirgazil @ 2019-03-07 21:02 UTC (permalink / raw)
  To: Guile User

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/





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-09 19:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 21:02 SRFI 64: How do I create a test-runner stub sirgazil
2019-03-07 23:40 ` Christopher Lam
2019-03-08 13:24   ` sirgazil
2019-03-09 19:58 ` sirgazil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).