summaryrefslogtreecommitdiff
path: root/lib/Test
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-07-27 19:20:45 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-07-27 19:20:45 +0000
commit27caa5c10b08266a9617a2ffa79bff9b3e7a01ef (patch)
treee98ec815db60aa1a21716539aba978bcfe14f909 /lib/Test
parent84a725ce7fe8d91d8384edf0aeea552b4d19c40e (diff)
downloadperl-27caa5c10b08266a9617a2ffa79bff9b3e7a01ef.tar.gz
Upgrade to Test::Harness 2.29.
p4raw-id: //depot/perl@20238
Diffstat (limited to 'lib/Test')
-rw-r--r--lib/Test/Harness.pm6
-rw-r--r--lib/Test/Harness/Straps.pm8
-rw-r--r--lib/Test/Harness/t/assert.t4
-rw-r--r--lib/Test/Harness/t/callback.t5
-rw-r--r--lib/Test/Harness/t/strap-analyze.t4
-rw-r--r--lib/Test/Harness/t/strap.t14
-rw-r--r--lib/Test/Harness/t/test-harness.t2
7 files changed, 23 insertions, 20 deletions
diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm
index 609c23f325..cc1dd325e8 100644
--- a/lib/Test/Harness.pm
+++ b/lib/Test/Harness.pm
@@ -1,5 +1,5 @@
# -*- Mode: cperl; cperl-indent-level: 4 -*-
-# $Id: Harness.pm,v 1.47 2003/04/24 19:33:05 andy Exp $
+# $Id: Harness.pm,v 1.52 2003/07/17 19:02:48 andy Exp $
package Test::Harness;
@@ -22,7 +22,7 @@ use vars qw($VERSION $Verbose $Switches $Have_Devel_Corestack $Curtest
$Have_Devel_Corestack = 0;
-$VERSION = '2.28';
+$VERSION = '2.29';
$ENV{HARNESS_ACTIVE} = 1;
@@ -898,7 +898,7 @@ sub _create_fmts {
}
}
-sub canonfailed ($@) {
+sub canonfailed ($$@) {
my($max,$skipped,@failed) = @_;
my %seen;
@failed = sort {$a <=> $b} grep !$seen{$_}++, @failed;
diff --git a/lib/Test/Harness/Straps.pm b/lib/Test/Harness/Straps.pm
index 058070b991..dc3e4b644a 100644
--- a/lib/Test/Harness/Straps.pm
+++ b/lib/Test/Harness/Straps.pm
@@ -358,13 +358,7 @@ sub _INC2PERL5LIB {
$self->{_old5lib} = $ENV{PERL5LIB};
- my @filtered_inc = $self->_filtered_INC;
- my @clean_inc = grep !/\Q$Config{path_sep}/, @filtered_inc;
- my @naughty_inc = grep /\Q$Config{path_sep}/, @filtered_inc;
- warn "Test::Harness can't handle \@INC directories with ".
- "'$Config{path_sep}': @naughty_inc\n" if @naughty_inc;
-
- return join $Config{path_sep}, @clean_inc;
+ return join $Config{path_sep}, $self->_filtered_INC;
}
=item B<_filtered_INC>
diff --git a/lib/Test/Harness/t/assert.t b/lib/Test/Harness/t/assert.t
index 9ff7305b29..11a4ed78a7 100644
--- a/lib/Test/Harness/t/assert.t
+++ b/lib/Test/Harness/t/assert.t
@@ -12,9 +12,9 @@ BEGIN {
use strict;
-use Test::More tests => 6;
+use Test::More tests => 7;
-use Test::Harness::Assert;
+use_ok( 'Test::Harness::Assert' );
ok( defined &assert, 'assert() exported' );
diff --git a/lib/Test/Harness/t/callback.t b/lib/Test/Harness/t/callback.t
index d77495887c..646e81f398 100644
--- a/lib/Test/Harness/t/callback.t
+++ b/lib/Test/Harness/t/callback.t
@@ -43,10 +43,11 @@ my $SAMPLE_TESTS = $ENV{PERL_CORE}
test other other test other )],
);
-plan tests => scalar keys %samples;
+plan tests => 2 + scalar keys %samples;
-use Test::Harness::Straps;
+use_ok( 'Test::Harness::Straps' );
my $strap = Test::Harness::Straps->new;
+isa_ok( $strap, 'Test::Harness::Straps' );
$strap->{callback} = sub {
my($self, $line, $type, $totals) = @_;
push @out, $type;
diff --git a/lib/Test/Harness/t/strap-analyze.t b/lib/Test/Harness/t/strap-analyze.t
index b42c875360..70f973dbd9 100644
--- a/lib/Test/Harness/t/strap-analyze.t
+++ b/lib/Test/Harness/t/strap-analyze.t
@@ -460,7 +460,7 @@ my %samples = (
},
);
-plan tests => (keys(%samples) * 4) + 3;
+plan tests => (keys(%samples) * 5) + 4;
use_ok('Test::Harness::Straps');
@@ -480,6 +480,7 @@ while( my($test, $expect) = each %samples ) {
my $test_path = File::Spec->catfile($SAMPLE_TESTS, $test);
my $strap = Test::Harness::Straps->new;
+ isa_ok( $strap, 'Test::Harness::Straps' );
my %results = $strap->analyze_file($test_path);
is_deeply($results{details}, $expect->{details}, "$test details" );
@@ -507,5 +508,6 @@ while( my($test, $expect) = each %samples ) {
my $strap = Test::Harness::Straps->new;
+isa_ok( $strap, 'Test::Harness::Straps' );
ok( !$strap->analyze_file('I_dont_exist') );
is( $strap->{error}, "I_dont_exist does not exist" );
diff --git a/lib/Test/Harness/t/strap.t b/lib/Test/Harness/t/strap.t
index a69f0c6eba..d74ea64da3 100644
--- a/lib/Test/Harness/t/strap.t
+++ b/lib/Test/Harness/t/strap.t
@@ -12,14 +12,12 @@ BEGIN {
use strict;
-use Test::More tests => 147;
-
+use Test::More tests => 170;
use_ok('Test::Harness::Straps');
my $strap = Test::Harness::Straps->new;
-ok( defined $strap && $strap->isa("Test::Harness::Straps"), 'new()' );
-
+isa_ok( $strap, 'Test::Harness::Straps', 'new()' );
### Testing _is_comment()
@@ -39,6 +37,7 @@ my %comments = (
while( my($line, $line_comment) = each %comments ) {
my $strap = Test::Harness::Straps->new;
+ isa_ok( $strap, 'Test::Harness::Straps' );
my $name = substr($line, 0, 20);
ok( $strap->_is_comment($line, \$comment), " comment '$name'" );
@@ -104,6 +103,7 @@ my %headers = (
while( my($header, $expect) = each %headers ) {
my $strap = Test::Harness::Straps->new;
+ isa_ok( $strap, 'Test::Harness::Straps' );
ok( $strap->_is_header($header), "_is_header() is a header '$header'" );
@@ -185,6 +185,8 @@ my @untests = (
);
foreach my $line (@untests) {
my $strap = Test::Harness::Straps->new;
+ isa_ok( $strap, 'Test::Harness::Straps' );
+
my %test = ();
ok( !$strap->_is_test($line, \%test), "_is_test() disregards '$line'" );
@@ -204,6 +206,8 @@ my %bails = (
while( my($line, $expect) = each %bails ) {
my $strap = Test::Harness::Straps->new;
+ isa_ok( $strap, 'Test::Harness::Straps' );
+
my $reason;
ok( $strap->_is_bail_out($line, \$reason), "_is_bail_out() spots '$line'");
is( $reason, $expect, ' with the right reason' );
@@ -218,6 +222,8 @@ my @unbails = (
foreach my $line (@unbails) {
my $strap = Test::Harness::Straps->new;
+ isa_ok( $strap, 'Test::Harness::Straps' );
+
my $reason;
ok( !$strap->_is_bail_out($line, \$reason),
diff --git a/lib/Test/Harness/t/test-harness.t b/lib/Test/Harness/t/test-harness.t
index 8a5f687fdb..1af11442bd 100644
--- a/lib/Test/Harness/t/test-harness.t
+++ b/lib/Test/Harness/t/test-harness.t
@@ -472,8 +472,8 @@ my %samples = (
plan tests => (keys(%samples) * 8) + 1;
-use Test::Harness;
use_ok('Test::Harness');
+use Test::Harness; # So that we don't get "used only once" warnings on the next line
$Test::Harness::Switches = '"-Mstrict"';
tie *NULL, 'My::Dev::Null' or die $!;