Stories
Slash Boxes
Comments
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)

rblackwe
  (email not shown publicly)
http://robertblackwell.com/
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 = 'http://www.southsideworks.com/showtimes.htm';
$mech->get_ok( $uri );
$mech->content_contains( "The Prestige", "Desc " );
$mech->content_contains( "Elephant's Dream", "Desc " );

#!/usr/local/bin/perl
use Test::More qw( no_plan );
my $command = `ping -o robertblackwell.com`;
like ($command , qr/216.146.203.240/ );

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

    http://use.perl.org/~jk2addict/journal/31406 [perl.org]

    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 (http://search.cpan.org/~NIKC/ [cpan.org]). All designed to test the environment in which code will be running, rather than the code itself.