Acme-EyeDrops
view release on metacpan or search on metacpan
1.45 Mon Dec 27 17:15:04 2004
- new shape: halloween (thanks TheEnigma)
- new shape: koaladile (thanks Schwern)
- new shape: saturn
- renamed function slurp_tfile() to _slurp_tfile()
- regenerated zgen.t (gen.t changed due to slurp_tfile() change)
(regenerated it with: perl -w -I lib t/gen.t generate)
- pod coverage: documented slurp_yerself()
- tests: improved the ugly test suite a little
new test: 16_astride.t simple threads test
new test: 17_Orange.t tests pod coverage
split 00_Coffee.t into two (last bit is now 15_Buffy.t)
added slurp_yerself() tests to 13_to.t
added Regex => 0 tests to 05_Parrot.t
exercise regex_binmode_print_sightly() in 05_Parrot.t
new tests added to 05_Parrot.t/06_not.t/10_Ponie.t et al
in response to gaping holes detected by Devel::Cover
removed exit 0 from end of tests
- documentation: added new Error Handling section
- Devel::Cover results: stmt branch cond sub pod total
use lexical file handles now
can use readline() function now
- documentation: removed "A Slow Day" section
- documentation: added new "Victoria Bra, Secret Tango" section
- new shape: bra
- new shape: spider
- 01_mug.t: fixed rt #72163: perl -Mstrict -e 'open$['
'Can't use string ("0") as a symbol ref while "strict refs" in use'
This seems to be a long-standing perl bug fixed in 5.16
Fixed test simply by removing -Mstrict in 01_mug.t
- 16_astride.t: threads test, adjusted to avoid annoying
"Tests out of sequence" failure reports from CPAN testers
1.61 Mon May 20 21:59:42 2013
- Bug fix release for Perl 5.18.0
- Tragically, perl 5.18 requires a leading "use re 'eval'"
if you embed the program in a regex. To appease this change
in behavior, the Regex attribute now supports three different
"true" values:
1: add a leading "use re 'eval';" for Perl 5.18+ only
lib/Acme/EyeDrops.pm view on Meta::CPAN
The cam.pm Obfuscated Programming Contests at
F<http://cam.pm.org/projects_home.shtml>.
I<Perl Golf> was played monthly at
F<http://perlgolf.sourceforge.net/> and is now played mostly at
F<http://codegolf.com/>. Ton Hospel's excellent generic
golf tester can be got from
F<http://www.xs4all.nl/~thospel/golf/gentest.pl>.
The C<--$|> idiom (exploited in the I<A Somersaulting Camel>
section) is "explained" in this thread:
F<http://archive.develooper.com/fwp@perl.org/msg01360.html>.
L<Acme::Bleach>
L<Acme::Smirch>
L<Acme::Buffy>
L<Acme::Pony>
L<Acme::ChuckNorris>
L<Acme::AsciiArt2HtmlTable>
L<Acme::AsciiArtinator>
t/16_astride.t view on Meta::CPAN
#!/usr/bin/perl
# 16_astride.t - simple threads test.
# XXX: This test seems to generate occasional failures via CPAN testers
# with "Tests out of sequence".
# For now comment out all Test::More tests in do_one_thread()
# below to see if this makes any difference.
use strict;
use warnings;
use Config;
use Acme::EyeDrops qw(ascii_to_sightly sightly_to_ascii);
sub skip_test { print "1..0 # Skipped: $_[0]\n"; exit }
BEGIN {
$] >= 5.008 && $Config{'useithreads'} or skip_test('no threads');
eval { require threads };
skip_test('threads module required for testing threads') if $@;
'threads'->import();
eval { require Test::More };
skip_test('Test::More required for testing threads') if $@;
Test::More->import();
}
# --------------------------------------------------
$|=1;
my $Num_Threads = 3;
my $N_Iter = 10;
# plan tests => $Num_Threads * ($N_Iter * 2) + $Num_Threads;
plan tests => $Num_Threads;
sub do_one_thread {
my $kid = shift;
my $rc = 0;
print "# kid $kid start\n";
for my $j (1 .. $N_Iter) {
my $t1 = join("", map(chr, 0..255));
my $f1 = ascii_to_sightly($t1);
# unlike( $f1, qr/[^!"#\$%&'()*+,\-.\/:;<=>?\@\[\\\]^_`\{|\}~]/, 'ascii_to_sightly' );
if ($f1 =~ /[^!"#\$%&'()*+,\-.\/:;<=>?\@\[\\\]^_`\{|\}~]/) {
print STDERR "# $kid, $j: oops 1: $f1 contains unsightly chars\n";
++$rc;
t/16_astride.t view on Meta::CPAN
print STDERR "# $kid, $j: oops 2: $t1 ne $t1a\n";
++$rc;
}
}
print "# kid $kid exit\n";
return $rc;
}
my @kids = ();
for my $i (1 .. $Num_Threads) {
my $t = threads->new(\&do_one_thread, $i);
print "# parent $$: continue\n";
push @kids, $t;
}
for my $t (@kids) {
print "# parent $$: waiting for join\n";
my $rc = $t->join();
cmp_ok( $rc, '==', 0, "threads exit status is $rc" );
}
( run in 0.353 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )