Test output for simple-exceptions [ok]

Testing time: 0s

'/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/bin/csi' -script run.scm < /dev/null 2>&1

Testing SIMPLE-EXEPTIONS ...
----------------------------
'(define foo-exn (make-exn "foo-msg"))
... passed in (simple-exceptions?)
'(define bar-exn (make-exn "bar-msg" 'bar))
... passed in (simple-exceptions?)
(exn? (foo-exn 'nowhere))
... passed in (simple-exceptions?)
(bar-exn 'nowhere)
... passed in (simple-exceptions?)
(exn? (bar-exn 'nowhere))
... passed in (simple-exceptions?)
((exn-of? 'bar) (bar-exn 'nowhere))
... passed in (simple-exceptions?)
(not ((exn-of? 'bar) (foo-exn 'nowhere)))
... passed in (simple-exceptions?)
((exn-of? 'key) ((make-exn "msg" 'key) 'nowhere))
... passed in (simple-exceptions?)
'(define list-empty-exn (make-exn "argument list empty" 'list-empty))
... passed in (simple-exceptions?)
'(define (try-car lst)
   (if (null? lst) (raise (list-empty-exn 'try-car lst)) (car lst)))
... passed in (simple-exceptions?)
(not (with-exn-handler
       (lambda (exn) (if ((exn-of? 'list-empty) exn) #f #t))
       (lambda () (try-car '()))))
... passed in (simple-exceptions?)
(zero? (with-exn-handler (lambda (e) 0) (lambda () (/ 5 0))))
... passed in (simple-exceptions?)
(not (condition-case (try-car '()) ((exn list-empty) #f)))
... passed in (simple-exceptions?)
"GUARD"
... passed in (simple-exceptions?)
(null? (guard (exn (((exn-of? 'list-empty) exn) (car (arguments exn)))
                   (else #f))
              (try-car '())))
... passed in (simple-exceptions?)
(null? (handle-exceptions
         exn
         (if ((exn-of? 'list-empty) exn) (car (arguments exn)) #f)
         (try-car '())))
... passed in (simple-exceptions?)
(= (handle-exceptions
     cnd
     (cond ((assq 'a cnd) => cdr) ((assq 'b cnd)))
     (raise (list (cons 'a 42))))
   42)
... passed in (simple-exceptions?)
(= (guard (exn ((assq 'a exn) => cdr) ((assq 'b exn)))
          (raise (list (cons 'a 42))))
   42)
... passed in (simple-exceptions?)
(equal?
  (guard (exn ((assq 'a exn) => cdr) ((assq 'b exn)))
         (raise (list (cons 'b 23))))
  '(b . 23))
... passed in (simple-exceptions?)
(eq? (guard (exn (((exn-of? 'foo) exn) (location exn))
                 ((exn? exn) (message exn))
                 (else (arguments exn)))
            (raise ((make-exn "msg" 'foo) 'location-unknown)))
     'location-unknown)
... passed in (simple-exceptions?)
(string=?
  (guard (exn (((exn-of? 'foo) exn) (location exn))
              ((exn? exn) (message exn))
              (else (arguments exn)))
         (raise ((make-exn "nothing" 'bar) 'loc)))
  "nothing")
... passed in (simple-exceptions?)
(not (guard (exn (((exn-of? 'foo) exn) (location exn))
                 ((exn? exn) (message exn))
                 (else #f))
            (raise 'bar)))
... passed in (simple-exceptions?)

Results of SIMPLE-EXEPTIONS
----------------------------
All tests passed