X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCGI%2Ft%2Fcarp.t;h=9bf5465e09aebf52393c142da7e5308a2bcc8dee;hb=ac734d8bd697d0795c7d9ab8a3fa6068e4da1b0c;hp=1eebef937a4a5c4c3f3f04d0e0a5f1539e50ca6e;hpb=31f2a3990f7718ffeb53233b84d710d047b543f5;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/CGI/t/carp.t b/lib/CGI/t/carp.t index 1eebef9..9bf5465 100644 --- a/lib/CGI/t/carp.t +++ b/lib/CGI/t/carp.t @@ -1,13 +1,13 @@ # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 2 -*- #!/usr/local/bin/perl -w -BEGIN { - chdir 't' if -d 't'; - @INC = '../lib'; -} - use strict; -#use lib qw(t/lib); +use lib qw(t/lib); + +# Due to a bug in older versions of MakeMaker & Test::Harness, we must +# ensure the blib's are in @INC, else we might use the core CGI.pm +use lib qw(blib/lib blib/arch); + use Test::More tests => 42; use IO::Handle; @@ -96,7 +96,7 @@ is(@CGI::Carp::WARNINGS, 0, "_warn not called"); # Test that _warn is called at the correct time $CGI::Carp::WARN = 1; -my $save_expect_l = $expect_l = __LINE__ + 1; +$expect_l = __LINE__ + 1; like(CGI::Carp::warn("There is a problem"), "/] $id: There is a problem at $q_file line $expect_l.".'$/', "CGI::Carp::warn builds correct message"); @@ -171,7 +171,7 @@ untie *STDOUT; open(STDOUT, ">&REAL_STDOUT"); my $fname = $0; $fname =~ tr/<>-/\253\273\255/; # _warn does this so we have to also -is( $fake_out, "\n", +is( $fake_out, "\n", 'warningsToBrowser() on' ); is($CGI::Carp::EMIT_WARNINGS, 1, "Warnings turned off");