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

From: John W. Small (jsmall at atlantech.net)
Date: Wed Dec 25 12:11:53 EST 2002


The Test Suite in DrScheme 2.03 looks really nice!

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/20021225/2d4f1e01/attachment.html>

Posted on the users mailing list.