From: sirgazil <sirgazil@zoho.com>
To: Guile User <guile-user@gnu.org>
Subject: SRFI 64: How do I create a test-runner stub
Date: Thu, 7 Mar 2019 16:02:37 -0500 [thread overview]
Message-ID: <0048113f-e621-7047-8438-2dde5a54c08f@zoho.com> (raw)
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/
next reply other threads:[~2019-03-07 21:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-07 21:02 sirgazil [this message]
2019-03-07 23:40 ` SRFI 64: How do I create a test-runner stub Christopher Lam
2019-03-08 13:24 ` sirgazil
2019-03-09 19:58 ` sirgazil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0048113f-e621-7047-8438-2dde5a54c08f@zoho.com \
--to=sirgazil@zoho.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).