On Tue, Jul 24, 2001 at 06:39:29PM -0500, David L. Nicol wrote:
> [EMAIL PROTECTED] wrote:
> >  todo() setting a flag
> 
> That's the solution that doesn't break Perl's visibility rules.
> 
> Karonen's suggestion would work

Unfortunately, I discovered a problem.  Consider...

    {
        local $TODO = 'Fix off by one';

        package Foo;

        ok( ... );
    }

Since ok() wil have to check ${caller.'::TODO'} you can't switch
packages inside the TODO block.  This might seem an odd thing to do,
but I do it a lot when checking to make sure module exports are
working properly.

{
    local $TODO = 'Add some export tags';

    {
        package Test::Export::1;
        use Some::Module ':Foo';

        ok( defined &this );
        ok( defined &that );
    }

    {
        package Test::Export::2;
        use Some::Module ':Bar';

        ok( defined &moo );
        ok( defined &woo );
    }
}

The above will fail.  You'd have to be careful to put the C<local
$TODO> inside each block after the package switch.  I don't like that
caveat.


> using a source filter is not sufficiently portable for the purpose,
> right?

It's not a portability problem, it's that I don't trust we can parse
Perl accurately enough to avoid the filter from causing mysterious
bugs.


I'm being stubborn in tossing out the suggestions because I've already
got a pile of half-solutions and could pick any one of them.  So I'm
looking for a complete one.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <[EMAIL PROTECTED]>       Kwalitee Is Job One
Nature is pissed.
        http://www.unamerican.com/

Reply via email to