= Data::Dumper->new( [ [ grep { $_ ne '.' } @INC ] ] )->Terse(1)->Purity(1)
->Dump;
+# The tail of @INC is munged during core testing. We're only *really*
+# interested in whether 'wibble' makes it anyway.
+my $cmp_slice = $ENV{PERL_CORE} ? '[0..1]' : '';
+
my $test_template = <<'END';
#!/usr/bin/perl %s
sub _strip_dups {
my %%dups;
# Drop '.' which sneaks in on some platforms
- return grep { $_ ne '.' } grep { !$dups{$_}++ } @_;
+ my @r = grep { $_ ne '.' } grep { !$dups{$_}++ } @_;
+ return @r%s;
}
# Make sure we did something sensible with PERL5LIB
END
open TEST, ">inc_check.t.tmp";
-printf TEST $test_template, '', $inc, $inc;
+printf TEST $test_template, '', $cmp_slice, $inc, $inc;
close TEST;
open TEST, ">inc_check_taint.t.tmp";
-printf TEST $test_template, '-T', $taint_inc, $taint_inc;
+printf TEST $test_template, '-T', $cmp_slice, $taint_inc, $taint_inc;
close TEST;
END { 1 while unlink 'inc_check_taint.t.tmp', 'inc_check.t.tmp'; }
#!/usr/bin/perl -w
BEGIN {
- chdir 't' and @INC = '../lib' if $ENV{PERL_CORE};
+ if ( $ENV{PERL_CORE} ) {
+ chdir 't';
+ @INC = '../lib';
+ }
+ else {
+ push @INC, 't/lib';
+ }
}
use strict;
-use lib 't/lib';
use Test::More 'no_plan';
my $IsVMS = $^O eq 'VMS';
my $IsWin32 = $^O eq 'MSWin32';
-my $SAMPLE_TESTS
- = File::Spec->catdir( File::Spec->curdir, ($ENV{PERL_CORE} ? 'lib' : 't'),
- 'sample-tests' );
+my $SAMPLE_TESTS = File::Spec->catdir(
+ File::Spec->curdir,
+ ( $ENV{PERL_CORE} ? 'lib' : 't' ),
+ 'sample-tests'
+);
my %deprecated = map { $_ => 1 } qw(
TAP::Parser::good_plan
wait => 0,
version => 12,
},
- switches => {
- results => [
- { is_plan => TRUE,
- passed => TRUE,
- is_ok => TRUE,
- raw => '1..1',
- tests_planned => 1,
- },
- { actual_passed => TRUE,
- is_actual_ok => TRUE,
- passed => TRUE,
- is_ok => TRUE,
- is_test => TRUE,
- has_skip => FALSE,
- has_todo => FALSE,
- number => 1,
- description => "",
- explanation => '',
- },
- ],
- __ARGS__ => { switches => ['-Mstrict'] },
- plan => '1..1',
- passed => [1],
- actual_passed => [1],
- failed => [],
- actual_failed => [],
- todo => [],
- todo_passed => [],
- skipped => [],
- good_plan => TRUE,
- is_good_plan => TRUE,
- tests_planned => 1,
- tests_run => TRUE,
- parse_errors => [],
- 'exit' => 0,
- wait => 0,
- version => 12,
- },
+
+ # switches => {
+ # results => [
+ # { is_plan => TRUE,
+ # passed => TRUE,
+ # is_ok => TRUE,
+ # raw => '1..1',
+ # tests_planned => 1,
+ # },
+ # { actual_passed => TRUE,
+ # is_actual_ok => TRUE,
+ # passed => TRUE,
+ # is_ok => TRUE,
+ # is_test => TRUE,
+ # has_skip => FALSE,
+ # has_todo => FALSE,
+ # number => 1,
+ # description => "",
+ # explanation => '',
+ # },
+ # ],
+ # __ARGS__ => { switches => ['-Mstrict'] },
+ # plan => '1..1',
+ # passed => [1],
+ # actual_passed => [1],
+ # failed => [],
+ # actual_failed => [],
+ # todo => [],
+ # todo_passed => [],
+ # skipped => [],
+ # good_plan => TRUE,
+ # is_good_plan => TRUE,
+ # tests_planned => 1,
+ # tests_run => TRUE,
+ # parse_errors => [],
+ # 'exit' => 0,
+ # wait => 0,
+ # version => 12,
+ # },
inc_taint => {
results => [
{ is_plan => TRUE,
tests_planned => 5,
tests_run => 5,
parse_errors =>
- ['Explicit TAP version must be at least 13. Got version 12'],
+ [ 'Explicit TAP version must be at least 13. Got version 12' ],
'exit' => 0,
wait => 0,
version => 12,
tests_planned => 5,
tests_run => 5,
parse_errors =>
- ['If TAP version is present it must be the first line of output'],
+ [ 'If TAP version is present it must be the first line of output' ],
'exit' => 0,
wait => 0,
version => 12,
# the following acrobatics are necessary to make it easy for the
# Test::Builder::failure_output() method to be overridden when
# TAP::Parser is not installed. Otherwise, these tests will fail.
- unshift @{ $args->{switches} }, '-It/lib';
+
+ unshift @{ $args->{switches} },
+ $ENV{PERL_CORE} ? ( map {"-I$_"} @INC ) : ('-It/lib');
$args->{source} = File::Spec->catfile( $SAMPLE_TESTS, $test );
$args->{merge} = !$hide_fork;
my $parser = eval { analyze_test( $test, [@$results], $args ) };
my $error = $@;
- ok !$error, "'$test' should parse successfully" or diag $error;
+ ok !$error, "'$test' should parse successfully"
+ or diag $error;
if ($error) {
my $tests = 0;
}
}
-my %Unix2VMS_Exit_Codes = (
- 1 => 4,
-);
+my %Unix2VMS_Exit_Codes = ( 1 => 4, );
sub _vmsify_answer {
my ( $method, $answer ) = @_;
= $result->is_test
? $result->description
: $result->raw;
- $desc = $result->plan if $result->is_plan && $desc =~ /SKIP/i;
+ $desc = $result->plan
+ if $result->is_plan && $desc =~ /SKIP/i;
$desc =~ s/#/<hash>/g;
$desc =~ s/\s+/ /g; # Drop newlines
ok defined $expected,