Devel::Cover recommendations... or maybe not?

Ovid publiustemp-londonpm at
Thu Mar 15 15:57:29 GMT 2007

--- Tara Andrews <tla at> wrote:

> On 3/15/07, Pete Sergeant <pete at> wrote:
> > and perhaps you have to occasionally tie yourself in
> > knots trying to hit certain failure conditions (especially
> file-system
> > error ones),
> OK, I'll bite.  How?
> Seriously, a list of hints somewhere of "how to programmatically
> manufacture useful sets of edge cases" would be very useful to people
> who want complete testing for their software, but don't have a wizzo
> tester to get us from A to B.

  open my $fh, '>', $file or die $!;
  print $fh $something    or die $!;
  close $fh $something    or die $!;

Some of those 'or die' conditions can be extremely difficult to hit. 
The first could be easy, the rest, not so much.

Other times you'll have something like this and your tests are on

  if ( $^O eq 'MSWin32' ) {

Many folks aren't aware of this, but you can assign to $^O and that
lets you do this:

      local $^O = 'MSWin32';
      # windows-specific tests

But quite often that code is Windows-specific because it will only run
on Windows.



Buy the book --
Perl and CGI --

More information about the mailing list