[plt-scheme] Question about the test suite and modules

From: John W. Small (jsmall at atlantech.net)
Date: Fri Jan 3 17:57:15 EST 2003

Can  the test suite test modules? 

  I wanted to use it to test modules.  Suppose I have the following
  module foo

          (module foo mzscheme
              (provide (all-defined))
              (define (double x) (* 2 x)))

  and want to test it with

          call:    (double 2)
          expected:  4
  It looks like I need to create an intermediate program

      (require (file "./foo.scm"))

  and make the test cases against this testable program (versus
  a module).   Since  require must be at the top level I can't just
  write the call as

              (require foo)     ;   error - not at top level
              (double 2))

  Is there an easier way to write a test suite for foo and modules
  in general?

  Would it make sense to add pre and post processing to
  the test suite?  In other words the (require foo) could
  be included the pre processing.   The pre and post processing
  could be used to set up test jigs or structures that are used in
  a multitude of the test cases.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20030103/73180be7/attachment.html>

Posted on the users mailing list.