(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/test#!check-fail::t
    (make-struct-type
     'std/test#!check-fail::t
     '#f
     '3
     '!check-fail
     '()
     '#f
     '(e value loc)))
  (define std/test#!check-fail?
    (make-struct-predicate std/test#!check-fail::t))
  (define std/test#make-!check-fail
    (lambda _$args2497_
      (apply make-struct-instance std/test#!check-fail::t _$args2497_)))
  (define std/test#!check-fail-e
    (make-struct-field-accessor std/test#!check-fail::t '0))
  (define std/test#!check-fail-value
    (make-struct-field-accessor std/test#!check-fail::t '1))
  (define std/test#!check-fail-loc
    (make-struct-field-accessor std/test#!check-fail::t '2))
  (define std/test#!check-fail-e-set!
    (make-struct-field-mutator std/test#!check-fail::t '0))
  (define std/test#!check-fail-value-set!
    (make-struct-field-mutator std/test#!check-fail::t '1))
  (define std/test#!check-fail-loc-set!
    (make-struct-field-mutator std/test#!check-fail::t '2))
  (define std/test#!check-error::t
    (make-struct-type
     'std/test#!check-error::t
     '#f
     '3
     '!check-error
     '()
     '#f
     '(exn check loc)))
  (define std/test#!check-error?
    (make-struct-predicate std/test#!check-error::t))
  (define std/test#make-!check-error
    (lambda _$args2494_
      (apply make-struct-instance std/test#!check-error::t _$args2494_)))
  (define std/test#!check-error-exn
    (make-struct-field-accessor std/test#!check-error::t '0))
  (define std/test#!check-error-check
    (make-struct-field-accessor std/test#!check-error::t '1))
  (define std/test#!check-error-loc
    (make-struct-field-accessor std/test#!check-error::t '2))
  (define std/test#!check-error-exn-set!
    (make-struct-field-mutator std/test#!check-error::t '0))
  (define std/test#!check-error-check-set!
    (make-struct-field-mutator std/test#!check-error::t '1))
  (define std/test#!check-error-loc-set!
    (make-struct-field-mutator std/test#!check-error::t '2))
  (define std/test#!test-suite::t
    (make-struct-type
     'std/test#!test-suite::t
     '#f
     '3
     '!test-suite
     '()
     '#f
     '(desc thunk tests)))
  (define std/test#!test-suite?
    (make-struct-predicate std/test#!test-suite::t))
  (define std/test#make-!test-suite
    (lambda _$args2491_
      (apply make-struct-instance std/test#!test-suite::t _$args2491_)))
  (define std/test#!test-suite-desc
    (make-struct-field-accessor std/test#!test-suite::t '0))
  (define std/test#!test-suite-thunk
    (make-struct-field-accessor std/test#!test-suite::t '1))
  (define std/test#!test-suite-tests
    (make-struct-field-accessor std/test#!test-suite::t '2))
  (define std/test#!test-suite-desc-set!
    (make-struct-field-mutator std/test#!test-suite::t '0))
  (define std/test#!test-suite-thunk-set!
    (make-struct-field-mutator std/test#!test-suite::t '1))
  (define std/test#!test-suite-tests-set!
    (make-struct-field-mutator std/test#!test-suite::t '2))
  (define std/test#!test-case::t
    (make-struct-type
     'std/test#!test-case::t
     '#f
     '4
     '!test-case
     '()
     '#f
     '(desc checks fail error)))
  (define std/test#!test-case? (make-struct-predicate std/test#!test-case::t))
  (define std/test#make-!test-case
    (lambda _$args2488_
      (apply make-struct-instance std/test#!test-case::t _$args2488_)))
  (define std/test#!test-case-desc
    (make-struct-field-accessor std/test#!test-case::t '0))
  (define std/test#!test-case-checks
    (make-struct-field-accessor std/test#!test-case::t '1))
  (define std/test#!test-case-fail
    (make-struct-field-accessor std/test#!test-case::t '2))
  (define std/test#!test-case-error
    (make-struct-field-accessor std/test#!test-case::t '3))
  (define std/test#!test-case-desc-set!
    (make-struct-field-mutator std/test#!test-case::t '0))
  (define std/test#!test-case-checks-set!
    (make-struct-field-mutator std/test#!test-case::t '1))
  (define std/test#!test-case-fail-set!
    (make-struct-field-mutator std/test#!test-case::t '2))
  (define std/test#!test-case-error-set!
    (make-struct-field-mutator std/test#!test-case::t '3))
  (define std/test#!check-error::display-exception
    (lambda (_self2449_ _port2450_)
      (let* ((_self24512459_ _self2449_)
             (_E24532463_
              (lambda () (error '"No clause matching" _self24512459_)))
             (_K24542470_
              (lambda (_loc2466_ _check2467_ _exn2468_)
                (std/format#fprintf
                 _port2450_
                 '"~a at ~a: "
                 _check2467_
                 _loc2466_)
                (display-exception _exn2468_ _port2450_))))
        (if (let ()
              (declare (not safe))
              (##structure-instance-of?
               _self24512459_
               'std/test#!check-error::t))
            (let* ((_e24552473_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _self24512459_ '1)))
                   (_exn2476_ _e24552473_)
                   (_e24562478_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _self24512459_ '2)))
                   (_check2481_ _e24562478_)
                   (_e24572483_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _self24512459_ '3)))
                   (_loc2486_ _e24572483_))
              (_K24542470_ _loc2486_ _check2481_ _exn2476_))
            (_E24532463_)))))
  (bind-method!
   std/test#!check-error::t
   'display-exception
   std/test#!check-error::display-exception
   '#f)
  (define std/test#!check-fail::display-exception
    (lambda (_self2288_ _port2289_)
      (let* ((_self22902298_ _self2288_)
             (_E22922302_
              (lambda () (error '"No clause matching" _self22902298_)))
             (_K22932309_
              (lambda (_loc2305_ _value2306_ _check2307_)
                (std/format#fprintf
                 _port2289_
                 '"check ~a at ~a FAILED: ~a~n"
                 _check2307_
                 _loc2305_
                 _value2306_))))
        (if (let ()
              (declare (not safe))
              (##structure-instance-of?
               _self22902298_
               'std/test#!check-fail::t))
            (let* ((_e22942312_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _self22902298_ '1)))
                   (_check2315_ _e22942312_)
                   (_e22952317_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _self22902298_ '2)))
                   (_value2320_ _e22952317_)
                   (_e22962322_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _self22902298_ '3)))
                   (_loc2325_ _e22962322_))
              (_K22932309_ _loc2325_ _value2320_ _check2315_))
            (_E22922302_)))))
  (bind-method!
   std/test#!check-fail::t
   'display-exception
   std/test#!check-fail::display-exception
   '#f)
  (define std/test#*test-verbose* '#t)
  (define std/test#set-test-verbose!
    (lambda (_val2164_) (set! std/test#*test-verbose* _val2164_)))
  (define std/test#verbose
    (lambda (_fmt2161_ . _args2162_)
      (if std/test#*test-verbose*
          (apply std/format#printf _fmt2161_ _args2162_)
          '#!void)))
  (define std/test#not-eq?
    (lambda (_x2158_ _y2159_) (not (eq? _x2158_ _y2159_))))
  (define std/test#not-eqv?
    (lambda (_x2155_ _y2156_) (not (eqv? _x2155_ _y2156_))))
  (define std/test#equal-values?
    (lambda (_obj-a2152_ _obj-b2153_)
      (if (let () (declare (not safe)) (##values? _obj-a2152_))
          (if (let () (declare (not safe)) (##values? _obj-b2153_))
              (equal? (let ()
                        (declare (not safe))
                        (##vector->list _obj-a2152_))
                      (let ()
                        (declare (not safe))
                        (##vector->list _obj-b2153_)))
              '#f)
          (equal? _obj-a2152_ _obj-b2153_))))
  (define std/test#not-equal-values?
    (lambda (_x2149_ _y2150_) (not (std/test#equal-values? _x2149_ _y2150_))))
  (define std/test#with-check-error
    (lambda (_thunk2138_ _what2139_ _loc2140_)
      (with-exception-catcher
       (lambda (_g21412143_)
         (if '#t
             (let ((_e2146_ _g21412143_))
               (raise (let ()
                        (declare (not safe))
                        (##structure
                         std/test#!check-error::t
                         _e2146_
                         _what2139_
                         _loc2140_))))
             (raise _g21412143_)))
       (lambda () (_thunk2138_)))))
  (define std/test#current-test-case (make-parameter '#f))
  (define std/test#current-test-suite (make-parameter '#f))
  (define std/test#*tests* '())
  (define std/test#make-test-suite
    (lambda (_desc2135_ _thunk2136_)
      (let ()
        (declare (not safe))
        (##structure std/test#!test-suite::t _desc2135_ _thunk2136_ '()))))
  (define std/test#run-tests!
    (lambda (_suite2132_ . _more2133_)
      (std/test#test-begin!)
      (std/test#run-test-suite! _suite2132_)
      (for-each std/test#run-test-suite! _more2133_)))
  (define std/test#test-report-summary!
    (lambda ()
      (let ((_tests2130_ (reverse std/test#*tests*)))
        (if (null? _tests2130_)
            '#!void
            (begin
              (std/format#eprintf '"--- Test Summary\n")
              (for-each std/test#test-suite-summary! _tests2130_)
              (std/format#eprintf '"~a~n" (std/test#test-result)))))))
  (define std/test#test-result
    (lambda ()
      (let _lp2086_ ((_rest2088_ std/test#*tests*))
        (let* ((_rest20892097_ _rest2088_)
               (_else20912105_ (lambda () 'OK))
               (_K20932117_
                (lambda (_rest2108_ _suite2109_)
                  (if (ormap1 (lambda (_$obj2111_)
                                (or (##structure-ref
                                     _$obj2111_
                                     '3
                                     std/test#!test-case::t
                                     '#f)
                                    (##structure-ref
                                     _$obj2111_
                                     '4
                                     std/test#!test-case::t
                                     '#f)))
                              (##structure-ref
                               _suite2109_
                               '3
                               std/test#!test-suite::t
                               '#f))
                      'FAILURE
                      (_lp2086_ _rest2108_)))))
          (if (let () (declare (not safe)) (##pair? _rest20892097_))
              (let ((_hd20942120_
                     (let () (declare (not safe)) (##car _rest20892097_)))
                    (_tl20952122_
                     (let () (declare (not safe)) (##cdr _rest20892097_))))
                (let* ((_suite2125_ _hd20942120_) (_rest2127_ _tl20952122_))
                  (_K20932117_ _rest2127_ _suite2125_)))
              (_else20912105_))))))
  (define std/test#test-suite-summary!
    (lambda (_suite2061_)
      (letrec ((_print-failed2063_
                (lambda (_tc2073_)
                  (let ((_$e2075_
                         (##structure-ref
                          _tc2073_
                          '3
                          std/test#!test-case::t
                          '#f)))
                    (if _$e2075_
                        ((lambda (_fail2078_)
                           (std/format#eprintf
                            '"~a: Check FAILED ~a at ~a~n"
                            (##structure-ref
                             _tc2073_
                             '1
                             std/test#!test-case::t
                             '#f)
                            (##structure-ref
                             _fail2078_
                             '1
                             std/test#!check-fail::t
                             '#f)
                            (##structure-ref
                             _fail2078_
                             '3
                             std/test#!check-fail::t
                             '#f)))
                         _$e2075_)
                        (let ((_$e2080_
                               (##structure-ref
                                _tc2073_
                                '4
                                std/test#!test-case::t
                                '#f)))
                          (if _$e2080_
                              ((lambda (_exn2083_)
                                 (std/format#eprintf
                                  '"~a: ERROR "
                                  (##structure-ref
                                   _tc2073_
                                   '1
                                   std/test#!test-case::t
                                   '#f))
                                 (display-exception
                                  _exn2083_
                                  (current-error-port)))
                               _$e2080_)
                              '#!void)))))))
        (let ((_tests2065_
               (##structure-ref _suite2061_ '3 std/test#!test-suite::t '#f)))
          (if (ormap1 (lambda (_$obj2067_)
                        (or (##structure-ref
                             _$obj2067_
                             '3
                             std/test#!test-case::t
                             '#f)
                            (##structure-ref
                             _$obj2067_
                             '4
                             std/test#!test-case::t
                             '#f)))
                      _tests2065_)
              (begin
                (std/format#eprintf
                 '"~a: FAILED~n"
                 (##structure-ref _suite2061_ '1 std/test#!test-suite::t '#f))
                (for-each _print-failed2063_ _tests2065_))
              (std/format#eprintf
               '"~a: OK~n"
               (##structure-ref
                _suite2061_
                '1
                std/test#!test-suite::t
                '#f)))))))
  (define std/test#test-begin! (lambda () (set! std/test#*tests* '())))
  (define std/test#test-add-test!
    (lambda (_suite2058_)
      (set! std/test#*tests* (cons _suite2058_ std/test#*tests*))))
  (define std/test#run-test-suite!
    (lambda (_suite2055_)
      (std/test#test-suite-begin! _suite2055_)
      (call-with-parameters
       (lambda ()
         ((##structure-ref _suite2055_ '2 std/test#!test-suite::t '#f)))
       std/test#current-test-suite
       _suite2055_)
      (std/test#test-suite-end! _suite2055_)))
  (define std/test#test-suite-begin!
    (lambda (_suite2053_)
      (##structure-set! _suite2053_ '() '3 std/test#!test-suite::t '#f)
      (std/test#test-add-test! _suite2053_)
      (std/format#eprintf
       '"Test suite: ~a~n"
       (##structure-ref _suite2053_ '1 std/test#!test-suite::t '#f))))
  (define std/test#test-suite-end!
    (lambda (_suite2045_)
      (if (find (lambda (_$obj2047_)
                  (or (##structure-ref
                       _$obj2047_
                       '3
                       std/test#!test-case::t
                       '#f)
                      (##structure-ref
                       _$obj2047_
                       '4
                       std/test#!test-case::t
                       '#f)))
                (##structure-ref _suite2045_ '3 std/test#!test-suite::t '#f))
          (std/format#eprintf '"*** Test FAILED~n")
          (std/format#eprintf '"... All tests OK~n"))))
  (define std/test#test-suite-add-test!
    (lambda (_suite2042_ _tc2043_)
      (##structure-set!
       _suite2042_
       (cons _tc2043_
             (##structure-ref _suite2042_ '3 std/test#!test-suite::t '#f))
       '3
       std/test#!test-suite::t
       '#f)))
  (define std/test#run-test-case!
    (lambda (_desc2024_ _thunk2025_)
      (let ((_tc2027_
             (let ()
               (declare (not safe))
               (##structure std/test#!test-case::t _desc2024_ '0 '#f '#f))))
        (std/test#test-case-begin! _tc2027_)
        (with-exception-catcher
         (lambda (_g20282030_)
           (if ((lambda (_$obj2033_)
                  (let ()
                    (declare (not safe))
                    (##structure-instance-of?
                     _$obj2033_
                     'std/test#!check-fail::t)))
                _g20282030_)
               (let ((_e2036_ _g20282030_))
                 (##structure-set!
                  _tc2027_
                  _e2036_
                  '3
                  std/test#!test-case::t
                  '#f))
               (if '#t
                   (let ((_e2038_ _g20282030_))
                     (##structure-set!
                      _tc2027_
                      _e2038_
                      '4
                      std/test#!test-case::t
                      '#f))
                   (raise _g20282030_))))
         (lambda ()
           (call-with-parameters
            (lambda () (_thunk2025_))
            std/test#current-test-case
            _tc2027_)))
        (if std/test#*test-verbose* (force-output) '#!void)
        (std/test#test-case-end! _tc2027_))))
  (define std/test#test-case-begin!
    (lambda (_tc2015_)
      (std/format#eprintf
       '"Test case: ~a~n"
       (##structure-ref _tc2015_ '1 std/test#!test-case::t '#f))
      (let ((_$e2017_ (std/test#current-test-suite)))
        (if _$e2017_
            ((lambda (_g20192021_)
               (std/test#test-suite-add-test! _g20192021_ _tc2015_))
             _$e2017_)
            '#!void))))
  (define std/test#test-case-end!
    (lambda (_tc2003_)
      (let ((_$e2005_
             (##structure-ref _tc2003_ '3 std/test#!test-case::t '#f)))
        (if _$e2005_
            ((lambda (_fail2008_)
               (std/format#eprintf
                '"*** FAILED: ~a at ~a; value: ~s~n"
                (##structure-ref _fail2008_ '1 std/test#!check-fail::t '#f)
                (##structure-ref _fail2008_ '3 std/test#!check-fail::t '#f)
                (##structure-ref _fail2008_ '2 std/test#!check-fail::t '#f)))
             _$e2005_)
            (let ((_$e2010_
                   (##structure-ref _tc2003_ '4 std/test#!test-case::t '#f)))
              (if _$e2010_
                  ((lambda (_e2013_)
                     (std/format#eprintf '"*** ERROR: ")
                     (display-exception _e2013_ (current-error-port)))
                   _$e2010_)
                  (std/format#eprintf
                   '"... ~a checks OK~n"
                   (##structure-ref
                    _tc2003_
                    '2
                    std/test#!test-case::t
                    '#f))))))))
  (define std/test#test-case-add-check!
    (lambda (_tc2001_)
      (if _tc2001_
          (##structure-set!
           _tc2001_
           (fx+ (##structure-ref _tc2001_ '2 std/test#!test-case::t '#f) '1)
           '2
           std/test#!test-case::t
           '#f)
          '#!void)))
  (define std/test#test-check-e
    (lambda (_what1993_ _eqf1994_ _thunk1995_ _value1996_ _loc1997_)
      (std/test#test-case-add-check! (std/test#current-test-case))
      (let ((_val1999_
             (std/test#with-check-error _thunk1995_ _what1993_ _loc1997_)))
        (if (_eqf1994_ _val1999_ _value1996_)
            '#!void
            (raise (let ()
                     (declare (not safe))
                     (##structure
                      std/test#!check-fail::t
                      _what1993_
                      _val1999_
                      _loc1997_)))))))
  (define std/test#test-check-output
    (lambda (_what1985_ _thunk1986_ _value1987_ _loc1988_)
      (std/test#test-case-add-check! (std/test#current-test-case))
      (let ((_val1991_
             (with-output-to-string
              '()
              (lambda ()
                (std/test#with-check-error
                 _thunk1986_
                 _what1985_
                 _loc1988_)))))
        (if (equal? _val1991_ _value1987_)
            '#!void
            (raise (let ()
                     (declare (not safe))
                     (##structure
                      std/test#!check-fail::t
                      _what1985_
                      _val1991_
                      _loc1988_)))))))
  (define std/test#test-check-predicate
    (lambda (_what1978_ _thunk1979_ _pred1980_ _loc1981_)
      (std/test#test-case-add-check! (std/test#current-test-case))
      (let ((_val1983_
             (std/test#with-check-error _thunk1979_ _what1978_ _loc1981_)))
        (if (_pred1980_ _val1983_)
            '#!void
            (raise (let ()
                     (declare (not safe))
                     (##structure
                      std/test#!check-fail::t
                      _what1978_
                      _val1983_
                      _loc1981_)))))))
  (define std/test#test-check-exception
    (lambda (_what1966_ _thunk1967_ _pred1968_ _loc1969_)
      (std/test#test-case-add-check! (std/test#current-test-case))
      (call-with-current-continuation
       (lambda (_success1971_)
         (call-with-current-continuation
          (lambda (_fail-to-throw1973_)
            (let ((_val1976_
                   (with-exception-catcher
                    values
                    (lambda () (_thunk1967_) (_fail-to-throw1973_)))))
              (if (_pred1968_ _val1976_)
                  (_success1971_)
                  (raise (let ()
                           (declare (not safe))
                           (##structure
                            std/test#!check-fail::t
                            _what1966_
                            _val1976_
                            _loc1969_)))))))
         (raise (let ()
                  (declare (not safe))
                  (##structure
                   std/test#!check-fail::t
                   _what1966_
                   '(failed to throw an exception)
                   _loc1969_))))))))
