[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SRFI-64: test exception symbol
From: |
Vladimir Zhbanov |
Subject: |
Re: SRFI-64: test exception symbol |
Date: |
Thu, 30 Apr 2020 18:55:09 +0300 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
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