NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Pik Nits (Score:2)
is better written as
for better diagnostics on failure. Any time you're writing
you probably want unless your name is Nick Clark, in which case you reall, really meant '==' so itscmp_ok($a, '==', 1 )or Damian Conway, in which case there's probably a really good reason you used ok() instead of is().Even better would be:
Mentioning that you're "testing" something in a test name is redundant and redundant, strike that out. Then there's the matter of properly describing what you're testing. You're not testing the first parameter, there's no order that I can see here, you're testing that you can get A.
Finally, assuming you don't need $a, which you don't...
why clutter up your code with unnecessary temp variables?
The last test, as mentioned before, is better written as:
to remove all that life support around it. But what if $t->get('D') did return something? How would we know what it was? Same way we do with everything else, use is().
Reply to This