From: Michael G. Schwern Date: Fri, 11 Jan 2002 03:35:51 +0000 (-0500) Subject: [PATCH] is() undef/'' behavior change X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4940c44306f1533e993cbca6152c66067eca02ca;p=p5sagit%2Fp5-mst-13.2.git [PATCH] is() undef/'' behavior change Date: Fri, 11 Jan 2002 03:35:51 -0500 Message-ID: <20020111083551.GC30666@blackrider> Subject: [PATCH] Pod::InputObjects warnings & is() undef/'' fix From: Michael G Schwern Date: Fri, 11 Jan 2002 03:37:44 -0500 Message-ID: <20020111083744.GD30666@blackrider> p4raw-id: //depot/perl@14179 --- diff --git a/ext/re/re.t b/ext/re/re.t index ff3a3c5..1a8f278 100644 --- a/ext/re/re.t +++ b/ext/re/re.t @@ -1,12 +1,12 @@ #!./perl -use strict; - BEGIN { chdir 't' if -d 't'; @INC = '../lib'; } +use strict; + use Test::More tests => 13; require_ok( 're' ); @@ -31,7 +31,7 @@ like( $warn, qr/Useless use/, 'bits() should warn with no args' ); delete $ENV{PERL_RE_COLORS}; re::bits(0, 'debug'); -is( $ENV{PERL_RE_COLORS}, '', +is( $ENV{PERL_RE_COLORS}, undef, "... should not set regex colors given 'debug'" ); re::bits(0, 'debugcolor'); isnt( $ENV{PERL_RE_COLORS}, '', diff --git a/lib/AutoSplit.t b/lib/AutoSplit.t index 256b43f..7cc680e 100644 --- a/lib/AutoSplit.t +++ b/lib/AutoSplit.t @@ -115,7 +115,7 @@ foreach (@tests) { } # test n+1 - is ($output, $args{Get}, "Output from autosplit()ing $args{Name}"); + cmp_ok ($output, 'eq', $args{Get}, "Output from autosplit()ing $args{Name}"); if ($args{Files}) { $args{Files} =~ s!/!:!gs if $^O eq 'MacOS'; diff --git a/lib/DB.t b/lib/DB.t index d5237a9..e6fef9b 100644 --- a/lib/DB.t +++ b/lib/DB.t @@ -1,4 +1,4 @@ -#!./perl -w +#!./perl -Tw BEGIN { chdir 't' if -d 't'; @@ -79,8 +79,10 @@ BEGIN { } # test DB::_clientname() -is( DB::_clientname('foo=A(1)'), 'foo','DB::_clientname should return refname'); -is( DB::_clientname('bar'), '','DB::_clientname should not return non refname'); +is( DB::_clientname('foo=A(1)'), 'foo', + 'DB::_clientname should return refname'); +cmp_ok( DB::_clientname('bar'), 'eq', '', + 'DB::_clientname should not return non refname'); # test DB::next() and DB::step() { diff --git a/lib/ExtUtils/t/Command.t b/lib/ExtUtils/t/Command.t index 7115bea..3ff59b9 100644 --- a/lib/ExtUtils/t/Command.t +++ b/lib/ExtUtils/t/Command.t @@ -1,4 +1,4 @@ -#!./perl -w +#!./perl -Tw BEGIN { chdir 't' if -d 't'; @@ -71,7 +71,7 @@ BEGIN { ok( test_f(), 'testing non-existent file' ); @ARGV = ( 'ecmdfile' ); - is( ! test_f(), (-f 'ecmdfile'), 'testing non-existent file' ); + cmp_ok( ! test_f(), '==', (-f 'ecmdfile'), 'testing non-existent file' ); # these are destructive, have to keep setting @ARGV @ARGV = ( 'ecmdfile' ); diff --git a/lib/ExtUtils/t/Manifest.t b/lib/ExtUtils/t/Manifest.t index f531406..04c57ea 100644 --- a/lib/ExtUtils/t/Manifest.t +++ b/lib/ExtUtils/t/Manifest.t @@ -81,7 +81,7 @@ is( $res, 'bar', 'bar reported as new' ); use vars qw($ExtUtils::Manifest::Quiet); $ExtUtils::Manifest::Quiet = 1; ($res, $warn) = catch_warning( \&ExtUtils::Manifest::skipcheck ); -is( $warn, '', 'disabled warnings' ); +cmp_ok( $warn, ,'eq', '', 'disabled warnings' ); # add a skip file with a rule to skip itself add_file( 'MANIFEST.SKIP', "baz\n.SKIP" ); diff --git a/lib/blib.t b/lib/blib.t index 4e0d3ea..bb269c4 100644 --- a/lib/blib.t +++ b/lib/blib.t @@ -30,7 +30,7 @@ ok( $@ =~ /Cannot find blib/, 'Fails if blib directory not found' ); _mkdirs(qw(blib blib/arch blib/lib)); { - my $warnings; + my $warnings = ''; local $SIG{__WARN__} = sub { $warnings = join '', @_ }; use_ok('blib'); is( $warnings, '', 'use blib is niiiice and quiet' );