From: Vladimir Zhbanov <vzhbanov@gmail.com>
To: guile-user@gnu.org
Subject: Re: SRFI-64: test exception symbol
Date: Thu, 30 Apr 2020 18:55:09 +0300 [thread overview]
Message-ID: <20200430155509.GB16174@newvzh.lokolhoz> (raw)
In-Reply-To: <20200430150621.GA16174@newvzh.lokolhoz>
On Thu, Apr 30, 2020 at 06:06:21PM +0300, Vladimir Zhbanov wrote:
> Hi,
>
> In SRFI-64, is there a way to test what exception raised using
> test-error() or anything else? I know about looking into test
> logs (if 'test-error' is used), though that's not what I need. I
> need a way to be sure a test raises the exception it should raise.
To clarify things a little: in our project (in one of a dozen
test-suites :)) we already have a function that does checking of
what I'm asking about:
(define (%assert-thrown key thunk)
(catch key
(lambda ()
(thunk)
(throw 'test-failed-exception
(simple-format #f " assert-thrown: expected exception: ~S"
key)))
(lambda (key . args) #t)))
Is there something like this in SRFI-64?
--
Vladimir
(λ)επτόν EDA — https://github.com/lepton-eda
next prev parent reply other threads:[~2020-04-30 15:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 15:06 SRFI-64: test exception symbol Vladimir Zhbanov
2020-04-30 15:55 ` Vladimir Zhbanov [this message]
2020-05-01 9:58 ` Taylan Kammer
2020-05-01 19:20 ` Vladimir Zhbanov
2020-05-02 19:38 ` Taylan Kammer
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=20200430155509.GB16174@newvzh.lokolhoz \
--to=vzhbanov@gmail.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).