On Thu, Aug 30, 2001 at 02:18:31PM -0400, Joe McMahon wrote:
> >Hmmm. concat.t is waaaay too basic to use Test::More on it. delete.t
> >is pushing it. die.t and die_exit.t cannot be tested with Test::More
> >since it relies on that functionality.
> >
> Okay, not a problem. I can clean up the prints anyway:
>
> print "not " unless some_condition;
> print "ok nnn\n";
>
> goes to
>
> print (some _condition)
> ? "ok nnn\n";
> : "not ok nnn\n";
In those cases where Test::More isn't applicable, you should be able
to get away with an ok() function. You'll have to adjust it as
necessary for each op test to avoid whatever op you're testing.
my $test = 1;
sub ok {
my($ok, $name) = @_;
# You have to do it this way or VMS will get confused.
print $ok ? "ok $test - $name\n"
: "not ok $test - $name\n";
printf "# Failed test at line %d\n", (caller)[2] unless $ok;
$test++;
return $ok;
}
at bare minimum, you can (almost) always do:
my $test = 1;
sub ok { print $_[0] ? "ok $test\n" : "not ok $test\n"; $test++ }
for concat.t, you've got to hard code the string to avoid
concatination. So use printf.
my $test = 1;
sub ok {
my($ok, $name) = @_;
printf "%sok %d - %s\n", $ok ? "" : "not ", $test, $name;
printf "# Failed test at line %d\n", (caller)[2] unless $ok;
$test++;
return $ok;
}
etc... use your head and it should be ok.
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
slick and shiny crust
over my hairy anus
constipation sucks
-- Ken Flagg