I just updated the perlhack man page to include this:

   t/op/pack.t has a sensible ok() function, but if it didn't
   we could write one easily.

       my $test = 1;
       sub ok {
           my($ok) = @_;

           my $out = '';
           $out =  "not " unless $ok;
           $out .= "ok $test\n";

           $test++;
           return $ok;
       }

   so instead of this:

    print 'not ' unless "1.20.300.4000" eq sprintf "%vd", pack("U*",1,20,300,4000);
    print "ok $test\n"; $test++;

   we can write the (somewhat) more sensible:

    ok( "1.20.300.4000" eq sprintf "%vd", pack("U*",1,20,300,4000) );


Unfortunately, most of the perl test suite still does the ugly "print
'not '...".  So if you've got nothing to do for 5 or 10 minutes, grab
a test program at random from bleadperl, see if it does the "print"
thing, throw in an ok() function, convert its tests and send the patch
to perl-qa.  I'll give it a look over to make sure it's okay and send
it on to p5p.

Once we've got the suite using an ok() function, it's much easier to
switch selected tests over to Test::Simple/More.


PS See the perlhack man page about getting a copy of bleadperl
(perl-current).

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <[EMAIL PROTECTED]>       Kwalitee Is Job One
Carpe canem!  Seize the dog!  This cannot be right.
        -- The Critic

Reply via email to