define-below/test.ss
(module test mzscheme

  (require (planet "test.ss" ("schematics" "schemeunit.plt" 2 8))
           (planet "graphical-ui.ss" ("schematics" "schemeunit.plt" 2 8)))

  (test/graphical-ui
   (test-suite "define-below"
     (test-not-exn "good"
       (lambda ()
         (eval '(module good mzscheme
                  (require (file "define-below.ss"))
                  (provide f g)
                  (define-below (f x) (+ 1 x))
                  f
                  (f 1)
                  (define-below (g x) (+ 1 (f x)))))))
     (test-not-exn "good/multi"
       (lambda ()
         (eval '(module good mzscheme
                  (require (file "define-below.ss"))
                  (provide evenp oddp)
                  (define-values-below (evenp oddp)
                    (values (lambda (x)
                              (if (zero? x) #t (oddp (- x 1))))
                            (lambda (x)
                              (if (zero? x) #f (evenp (- x 1))))))
                  (evenp 4)
                  (oddp 4)))))
     (test-exn "bad" exn:fail:syntax?
       (lambda ()
         (eval '(module bad mzscheme
                  (require (file "define-below.ss"))
                  (define-below (h x) (+ 1 (j x)))
                  (define-below (j x) (+ 1 x))))))
     (test-exn "bad/multi" exn:fail:syntax?
       (lambda ()
         (eval '(module bad mzscheme
                  (require (file "define-below.ss"))
                  (j k)
                  (define-values-below (j k) (values - 1))))))))

  )