Acme-EyeDrops

 view release on metacpan or  search on metacpan

t/08_hoax.t  view on Meta::CPAN

# --------------------------------------------------

sub build_file {
   my ($f, $d) = @_;
   local *F; open(F, '>'.$f) or die "open '$f': $!";
   print F $d or die "write '$f': $!"; close(F);
}

# --------------------------------------------------

# my $have_stderr_redirect = 1;
# if ($^O eq 'MSWin32') {
#    Win32::IsWinNT() or $have_stderr_redirect = 0;
# }
# print $have_stderr_redirect ? "1..7\n" : "1..3\n";

print "1..8\n";

# --------------------------------------------------

my $camelstr = get_eye_string('camel');
my $tmpf = 'bill.tmp';
my $tmpf2 = 'bill2.tmp';

# -------------------------------------------------

t/19_surrounds.t  view on Meta::CPAN

#!/usr/bin/perl
# 19_surrounds.t
# Generate a new EyeDrops.pm as described in the doco:
# "EyeDropping EyeDrops.pm" section.
# Run various tests on the EyeDrop'ed EyeDrops.pm.
# Also generate sightly versions of 0..18 tests with a 'z' prefix.
# Since this test is very slow only run if the
# PERL_SMOKE environment variable is set.
#
# zsightly.t test works but the following might be written to stderr:
# Scalar found where operator expected at (eval 2) line 41, near "regex_eval_sightly($hellostr"
# This seems to happen only on Perl versions before 5.6.1. Is this a Perl bug?

use strict;
use File::Basename ();
use File::Copy ();
use File::Path ();
use Acme::EyeDrops qw(sightly);
use Test::Harness ();

t/19_surrounds.t  view on Meta::CPAN

   open(STDERR, ">&SAVERR") or die "error: restore STDERR: $!";
   open(STDOUT, ">&SAVOUT") or die "error: restore STDOUT: $!";
   # XXX: is this necessary to prevent leaks?
   close(SAVOUT) or die "error: close SAVOUT: $!";
   close(SAVERR) or die "error: close SAVERR: $!";

   my $outstr = Acme::EyeDrops::_slurp_tfile($outf);
   my $errstr = Acme::EyeDrops::_slurp_tfile($errf);

   print STDERR "\nstdout of TestHarness::runtests:\n$outstr\n";
   print STDERR "stderr of TestHarness::runtests:\n$errstr\n";

   $status or print "not ";
   ++$itest; print "ok $itest - TestHarness::runtests of $e\n";
}

# --------------------------------------------------

my %attrs = (
   Shape          => 'camel',
   Regex          => 0,



( run in 0.663 second using v1.01-cache-2.11-cpan-49f99fa48dc )