B-CodeLines
view release on metacpan or search on metacpan
examples/dolines.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict; use warnings;
use English;
use File::Basename;
use File::Spec;
my $dir = dirname(__FILE__);
my $libdir = File::Spec->catfile($dir, '..', 'lib');
# Something to make sure we are recursing subroutines.
sub five() {
5
}
my $file;
if (scalar @ARGV) {
$file = shift @ARGV;
die "Can't find file $file" unless -f $file;
} else {
$file = __FILE__;
}
open FH, '<', $file or die $!;
t/10-test-basic.t view on Meta::CPAN
use warnings; use strict;
use English; use File::Spec;
use File::Basename;
use Test::More;
if ($OSNAME eq 'MSWin32') {
plan skip_all => "Strawberry Perl doesn't handle backtick"
} else {
plan;
}
sub test_it($$$)
{
my ($invocation, $expect_ary, $msg) = @_;
my @lines = `$invocation`;
my $rc = $CHILD_ERROR >> 8;
is($rc, 0, "$msg run successfully");
map {chomp} @lines;
is_deeply(\@lines, $expect_ary, "$msg output compares");
}
my $top_dir = File::Spec->catfile(dirname(__FILE__), '..');
( run in 0.900 second using v1.01-cache-2.11-cpan-65fba6d93b7 )