Slash Boxes
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

use Perl Log In

Log In

[ Create a new account ]

rblackwe (5489)

  (email not shown publicly)
AOL IM: robertdblackwell (Add Buddy, Send Message)
Yahoo! ID: robertblackwell (Add User, Send Message)

Journal of rblackwe (5489)

Tuesday October 24, 2006
09:21 PM

Test things other that code with TAP.

[ #31412 ]

I am working on collecting examples of using TAP and TAP tools like prove to test things other than code. I hope to use these examples in a future talk.

I think that using TAP can be very effective in testing many situations.

I trust someone out there will have some very interesting examples.

Some examples:

use Test::More qw( no_plan );
use Test::WWW::Mechanize;
my $mech=Test::WWW::Mechanize->new();
my $uri = '';
$mech->get_ok( $uri );
$mech->content_contains( "The Prestige", "Desc " );
$mech->content_contains( "Elephant's Dream", "Desc " );

use Test::More qw( no_plan );
my $command = `ping -o`;
like ($command , qr/ );

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I assume you've seen my posts about testing crap that goes wrong at $work? []

    Unfortunately, most of the code is larger than would fit on a slide easily. The image tests are just -e $filename tests...the dup check is just a SELECT NAME, COUNT(*) AS TOTAL WHERE TOTAL > 1 kind of thing...the web page tests wouldn't make much sense outside of context...

    The excel import one might be interesting enough.
  • This is why I wrote Test::Net::Connect, Test::Symlink, Test::Unix::Group, and Test::Unix::User ( []). All designed to test the environment in which code will be running, rather than the code itself.