Acme-Incorporated
view release on metacpan or search on metacpan
$breakage = 9;
BreakMe::breakit();
is( $moving_on, 2, '... potentially breaking for loops early' );
}
my $oos = Acme::Incorporated::out_of_stock( 'foobar', 'foo/bar.pm' );
like( <$oos>, qr/print.+foobar is out of stock/,
'out_of_stock() should print an out of stock message' );
ok( ! $INC{'foo/bar.pm'}, '... not populating %INC for module' );
my @breaks = map { Acme::Incorporated::breaks() ? 1 : () } 1 .. 1000;
cmp_ok( @breaks, '>', 75,
'breaks() should be true more than 7.5% of the time' );
cmp_ok( @breaks, '<', 125,
'... and false less than 12.5% of the time' );
my @subs = map { Acme::Incorporated::bad_product() } 1 .. 2000;
my @empty = grep { $_ == \&Acme::Incorporated::empty_box } @subs;
cmp_ok( @empty, '>', 150,
'empty_box() should be called more than 7.5% of the time' );
cmp_ok( @empty, '<', 250,
'... and less than 12.5% of the time' );
my @breaking = grep { $_ == \&Acme::Incorporated::breaks_when_needed } @subs;
cmp_ok( @breaking, '>', 150,
'breaks_when_needed() should be called more than 7.5% of the time' );
cmp_ok( @breaking, '<', 250,
( run in 1.543 second using v1.01-cache-2.11-cpan-49f99fa48dc )