Michael G Schwern wrote:
On Sat, Feb 12, 2005 at 12:47:56PM -0500, David A. Golden wrote:

The trouble with this interface is sometimes you want to collect a bunch
of output from a bunch of different functions together.

That's why I suggested that it be prototyped to take a code block:

stdout_is {
   fcn1();
   # more processing
   fcn2();
} $expected, "comment";


Be very careful you do not alter the output with your code block.  For
example:

        stdout_is {
                print scalar caller;
        } scalar caller;

That's a good warning on code blocks, and worth documenting for a module like this, but I'm not sure it's going to be a big issue in writing test scripts. Unless you're testing the "print" built-in function, that test is more easily written as


  is(scalar caller, scalar caller)

or maybe even just as

   ok(1)

:-)

David



Reply via email to