Acme-EyeDrops
view release on metacpan or search on metacpan
- new program: demo/findshapes.pl
- tests: added property tests to 13_to.t
- tests: adjusted 19_surrounds.t for .eyp files
- new shape: schwern2 (shape schwern without the banner)
1.51 Sun September 11 23:17:33 2005
- new shape: adrianh
- minor enhancements to demo/findshapes.pl
- tests: improved property tests in 13_to.t
- tests: added InformHandler throw test to 07_a.t
- minor code improvements
1.52 Sun February 3 20:12:42 2008
- Bug fix release for Perl 5.10.0
- Yay, the EyeDrops test suite uncovers another perl bug. :-)
02_shatters.t (tests 2-4) and 09_Gallop.t (tests 3-6)
both failed on Perl 5.10.0 with "Out of memory!".
Workaround for now by commenting out these tests.
Need to investigate further and perlbug to P5P.
my $hellostr = <<'HELLO';
print "hello world\n";
HELLO
my $camelstr = get_eye_string('camel');
my $camel2str = $camelstr . "\n\n\n" . $camelstr;
my $tmpf = 'bill.tmp';
# Test bailing out via InformHandler when presented with a
# diabolical shape which sends sightly() into an infinite loop.
my $max_shapes = 5;
my $exp_throw_str = "bailing out after " . ($max_shapes+1) . " shapes.\n";
sub throw_inform {
$_[0] =~ /^(\d+) / or die "oops, invalid ihandler string";
$1 > $max_shapes and die "bailing out after $1 shapes.\n";
}
# Simple test of InformHandler.
my $inform_string;
sub test_inform { $inform_string .= $_[0] }
# -------------------------------------------------
my $itest = 0;
my $prog;
# -------------------------------------------------
eval {
sightly( { ShapeString => "#\n#\n#\n#\n#\n",
SourceString => "# Example nasty shape\n;1;\n",
InformHandler => \&throw_inform,
Regex => 1 } );
};
$@ or print "not ";
++$itest; print "ok $itest - InformHandler throw\n";
$@ eq $exp_throw_str or print "not ";
++$itest; print "ok $itest - InformHandler throw string\n";
# -------------------------------------------------
$prog = sightly({ Shape => 'camel',
SourceString => $hellostr,
BorderWidth => 2,
BorderGap => 1,
InformHandler => \&test_inform,
Regex => 1 } );
build_file($tmpf, $prog);
( run in 0.357 second using v1.01-cache-2.11-cpan-496ff517765 )