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.
Testing (Score:2)
This is an excellent point. I wonder if anyone has used Perl's new improved testing features to persuade their bosses to use Perl over some other language.
How do other languages stack up against Perl in testability?
Re:Testing (Score:2)
Someone feel free to disagree...
Re:Testing (Score:2)
While ruby's Test::Unit looks vaguely interesting, it doesn't look nearly as simple as Test::Harness + Test.pm (or Test::More). The thing about Test::Harness is that it's not a module, but a tool. And a nice tool at that - it shows me test progress,
Re:Testing (Score:1)
If you like is_deeply, see also Test::Differences (Score:1)
See also Test::More's no_plan option (Score:1)
Graphical test failure hotspot diagrams (Score:1)
And here's a neat page that shows how to map out your code coverage for failing and passing tests to show code that is likely to be involved with failed tests:
Now, when I break a test, I usually know what I changed, so I'm not sure how useful this is for me. For the automated perl smoke tests, it could be cool, though the profiling bit would slow the tests down a lot.
Anyway, just some cool stuff. See the related work on that site about using antia
Planning (Score:1)
See, nice and simple. No BEGIN blocks required. And, as somebody else mentioned, there's always no_plan if you're feeling lazy.
-Dom
Test::More (Score:2)
Have you considered using Test::More? It has much more useful testing facilities and it allows you to name tests, which can give you very descriptive testing information. Further, if a test fails, it often provides very useful diagnostic information such as telling you what value you were expecting in $foo and what value $foo actually received. Here's a sample from some tests of a "People" object that I have.
#
# testing is_senior_contact()
#
$sql = <<"END_SQL";
SELECT people_id, category_id
FRO