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

Reply via email to