[plt-scheme] testing modules

From: Ryan Culpepper (ryan_sml at yahoo.com)
Date: Tue Jun 6 07:49:23 EDT 2006

--- Prabhakar Ragde <plragde at uwaterloo.ca> wrote:

> I want to introduce students to the basics of the PLT module
> system at a particular point in a course. They don't know about
> I/O yet. They've been writing tests in HtDP style. But, although
> expressions in a module are evaluated when run with the module
> language selected in DrScheme, their values are not reported.
> Is the best thing to do to put the tests in an auxiliary file
> which requires the new module? That seems a bit awkward. Is there
> something short of Schemeunit I should be telling them 
> about? Thanks. --PR

If you're using DrScheme, you could use the graphical test boxes
(menu > Special > Insert Test Case).

That works fine if the module language is one of the HTDP languages.
For example:

(module m (lib "htdp-beginner.ss" "lang")
   <definitions>
   <test boxes>)

If you are using another module language (like mzscheme), then the
following seems to work:

(module m mzscheme
  (require (lib "test-case.ss" "test-suite" "private"))
  <definitions>
  <test boxes>)

On the other hand, it's probably not a good idea to require modules
in private subcollections. Perhaps someone else can suggest a better
way of getting test-box support, or maybe the maintainer of that
collection should add a public module to require.

Ryan


> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.