(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/srfi/78#check:write write)
  (define std/srfi/78#check:mode '#f)
  (define std/srfi/78#check-set-mode!
    (lambda (_mode2387_)
      (set! std/srfi/78#check:mode
            (let ((_$e2389_ _mode2387_))
              (if (eq? 'off _$e2389_)
                  '0
                  (if (eq? 'summary _$e2389_)
                      '1
                      (if (eq? 'report-failed _$e2389_)
                          '10
                          (if (eq? 'report _$e2389_)
                              '100
                              (error '"unrecognized mode" _mode2387_)))))))))
  (std/srfi/78#check-set-mode! 'report)
  (define std/srfi/78#check:correct '#f)
  (define std/srfi/78#check:failed '#f)
  (define std/srfi/78#check-reset!
    (lambda ()
      (set! std/srfi/78#check:correct '0)
      (set! std/srfi/78#check:failed '())))
  (define std/srfi/78#check:add-correct!
    (lambda ()
      (set! std/srfi/78#check:correct (+ std/srfi/78#check:correct '1))))
  (define std/srfi/78#check:add-failed!
    (lambda (_expression2381_ _actual-result2382_ _expected-result2383_)
      (set! std/srfi/78#check:failed
            (cons (list _expression2381_
                        _actual-result2382_
                        _expected-result2383_)
                  std/srfi/78#check:failed))))
  (std/srfi/78#check-reset!)
  (define std/srfi/78#check:report-expression
    (lambda (_expression2379_)
      (newline)
      (std/srfi/78#check:write _expression2379_)
      (display '" => ")))
  (define std/srfi/78#check:report-actual-result
    (lambda (_actual-result2377_)
      (std/srfi/78#check:write _actual-result2377_)
      (display '" ; ")))
  (define std/srfi/78#check:report-correct
    (lambda (_cases2375_)
      (display '"correct")
      (if (not (= _cases2375_ '1))
          (begin
            (display '" (")
            (display _cases2375_)
            (display '" cases checked)"))
          '#!void)
      (newline)))
  (define std/srfi/78#check:report-failed
    (lambda (_expected-result2373_)
      (display '"*** failed ***")
      (newline)
      (display '" ; expected result: ")
      (std/srfi/78#check:write _expected-result2373_)
      (newline)))
  (define std/srfi/78#check-report
    (lambda ()
      (if (>= std/srfi/78#check:mode '1)
          (begin
            (newline)
            (display '"; *** checks *** : ")
            (display std/srfi/78#check:correct)
            (display '" correct, ")
            (display (length std/srfi/78#check:failed))
            (display '" failed.")
            (if (or (null? std/srfi/78#check:failed)
                    (<= std/srfi/78#check:mode '1))
                (newline)
                (let* ((_w2364_ (car (reverse std/srfi/78#check:failed)))
                       (_expression2366_ (car _w2364_))
                       (_actual-result2368_ (cadr _w2364_))
                       (_expected-result2370_ (caddr _w2364_)))
                  (display '" First failed example:")
                  (newline)
                  (std/srfi/78#check:report-expression _expression2366_)
                  (std/srfi/78#check:report-actual-result _actual-result2368_)
                  (std/srfi/78#check:report-failed _expected-result2370_))))
          '#!void)))
  (define std/srfi/78#check-passed?
    (lambda (_expected-total-count2358_)
      (if (= (length std/srfi/78#check:failed) '0)
          (= std/srfi/78#check:correct _expected-total-count2358_)
          '#f)))
  (define std/srfi/78#check:proc
    (lambda (_expression2344_ _thunk2345_ _equal2346_ _expected-result2347_)
      (let ((_$e2349_ std/srfi/78#check:mode))
        (if (eq? '0 _$e2349_)
            '#f
            (if (eq? '1 _$e2349_)
                (let ((_actual-result2352_ (_thunk2345_)))
                  (if (_equal2346_ _actual-result2352_ _expected-result2347_)
                      (std/srfi/78#check:add-correct!)
                      (std/srfi/78#check:add-failed!
                       _expression2344_
                       _actual-result2352_
                       _expected-result2347_)))
                (if (eq? '10 _$e2349_)
                    (let ((_actual-result2354_ (_thunk2345_)))
                      (if (_equal2346_
                           _actual-result2354_
                           _expected-result2347_)
                          (std/srfi/78#check:add-correct!)
                          (begin
                            (std/srfi/78#check:report-expression
                             _expression2344_)
                            (std/srfi/78#check:report-actual-result
                             _actual-result2354_)
                            (std/srfi/78#check:report-failed
                             _expected-result2347_)
                            (std/srfi/78#check:add-failed!
                             _expression2344_
                             _actual-result2354_
                             _expected-result2347_))))
                    (if (eq? '100 _$e2349_)
                        (begin
                          (std/srfi/78#check:report-expression
                           _expression2344_)
                          (let ((_actual-result2356_ (_thunk2345_)))
                            (std/srfi/78#check:report-actual-result
                             _actual-result2356_)
                            (if (_equal2346_
                                 _actual-result2356_
                                 _expected-result2347_)
                                (begin
                                  (std/srfi/78#check:report-correct '1)
                                  (std/srfi/78#check:add-correct!))
                                (begin
                                  (std/srfi/78#check:report-failed
                                   _expected-result2347_)
                                  (std/srfi/78#check:add-failed!
                                   _expression2344_
                                   _actual-result2356_
                                   _expected-result2347_)))))
                        (error '"unrecognized check:mode"
                               std/srfi/78#check:mode))))))
      (if '#f '#f '#!void)))
  (define std/srfi/78#check:proc-ec
    (lambda (_w2336_)
      (let ((_correct?2338_ (car _w2336_))
            (_expression2339_ (cadr _w2336_))
            (_actual-result2340_ (caddr _w2336_))
            (_expected-result2341_ (cadddr _w2336_))
            (_cases2342_ (car (cddddr _w2336_))))
        (if _correct?2338_
            (begin
              (if (>= std/srfi/78#check:mode '100)
                  (begin
                    (std/srfi/78#check:report-expression _expression2339_)
                    (std/srfi/78#check:report-actual-result
                     _actual-result2340_)
                    (std/srfi/78#check:report-correct _cases2342_))
                  '#!void)
              (std/srfi/78#check:add-correct!))
            (begin
              (if (>= std/srfi/78#check:mode '10)
                  (begin
                    (std/srfi/78#check:report-expression _expression2339_)
                    (std/srfi/78#check:report-actual-result
                     _actual-result2340_)
                    (std/srfi/78#check:report-failed _expected-result2341_))
                  '#!void)
              (std/srfi/78#check:add-failed!
               _expression2339_
               _actual-result2340_
               _expected-result2341_)))))))
