#!./perl
BEGIN {
+ chdir 't' if -d 't';
if ($^O eq 'MacOS') {
@INC = qw(: ::lib ::macos:lib);
+ } else {
+ @INC = '../lib';
}
}
#!./perl
BEGIN {
+ chdir 't' if -d 't';
if ($^O eq 'MacOS') {
@INC = qw(: ::lib ::macos:lib);
+ } else {
+ @INC = '../lib';
}
}
my $cwd;
eval { $cwd = getcwd; };
is( $@, '', 'getcwd() does not explode under taint mode' );
-ok( is_tainted($cwd), "it's return value is tainted" );
+ok( is_tainted($cwd), "its return value is tainted" );
#!./perl -w
BEGIN {
+ chdir 't' if -d 't';
@INC = '../lib';
require Config; import Config;
if ($Config{'extensions'} !~ /\bDB_File\b/) {
#!./perl -w
BEGIN {
+ chdir 't' if -d 't';
@INC = '../lib';
require Config; import Config;
if ($Config{'extensions'} !~ /\bDB_File\b/) {
#!./perl -w
BEGIN {
+ chdir 't' if -d 't';
@INC = '../lib';
require Config; import Config;
if ($Config{'extensions'} !~ /\bDB_File\b/) {
#!./perl
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
# A modest test: exercises only O_WRONLY, O_CREAT, and O_RDONLY.
# Have to be modest to be portable: could possibly extend testing
# also to O_RDWR and O_APPEND, but dunno about the portability of,
# -*- 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);
use Test::More tests => 42;
use IO::Handle;
# Test that _warn is called at the correct time
$CGI::Carp::WARN = 1;
-$expect_l = __LINE__ + 1;
+my $save_expect_l = $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");
open(STDOUT, ">&REAL_STDOUT");
my $fname = $0;
$fname =~ tr/<>-/\253\273\255/; # _warn does this so we have to also
-is( $fake_out, "<!-- warning: There is a problem at $fname line 95. -->\n",
+is( $fake_out, "<!-- warning: There is a problem at $fname line $save_expect_l. -->\n",
'warningsToBrowser() on' );
is($CGI::Carp::EMIT_WARNINGS, 1, "Warnings turned off");
#!/usr/local/bin/perl -w
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
use strict;
use Test::More tests => 86;
use CGI::Util qw(escape unescape);
my %Expect_Dir = (); # what we expect for $File::Find::dir
my ($cwd, $cwd_untainted);
-use Config;
BEGIN {
chdir 't' if -d 't';
unshift @INC => '../lib';
+}
+use Config;
+
+BEGIN {
for (keys %ENV) { # untaint ENV
($ENV{$_}) = $ENV{$_} =~ /(.*)/;
}
#!./perl
BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
+ # Can't chdir in BEGIN before FindBin runs, as it then can't find us.
+ @INC = -d 't' ? 'lib' : '../lib';
}
print "1..1\n";
#!./perl -w
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
use Net::Config;
use Net::FTP;
+#!./perl -w
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
use Net::Domain qw(hostname domainname hostdomain);
use Net::Config;
#!./perl -w
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
use Net::Config;
use Net::NNTP;
use Net::Cmd qw(CMD_REJECT);
#!./perl -w
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
use Net::Config;
use Net::SMTP;
#! /usr/local/bin/perl -w
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
use Carp;
use Switch qw(Perl6 __ fallthrough);
+#! /usr/local/bin/perl -w
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
use Switch;
print "1..4\n";
#! /usr/local/bin/perl -w
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
use Carp;
use Switch qw(__ fallthrough);
#!./perl
BEGIN {
- chdir 't' unless -d 't';
+ chdir 't' if -d 't';
@INC = '../lib';
}
# This feature requires a fairly new version of Test::Harness
BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
require Test::Harness;
if( $Test::Harness::VERSION < 1.20 ) {
print "1..0\n";
+#! /usr/local/bin/perl -w
BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
require Test::Harness;
require Test::More;
#!./perl
-BEGIN { @INC = '../lib' }
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
require "bigfloat.pl";
$test = 0;
#!./perl
-BEGIN { @INC = '../lib' }
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
require "bigint.pl";
$test = 0;
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
use integer;
use Test::More tests => 11;
# $RCSfile: flip.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:52 $
+chdir 't' if -d 't';
+
print "1..10\n";
@a = (1,2,3,4,5,6,7,8,9,10,11,12);
package Foo;
BEGIN {
+ chdir 't' if -d 't';
@INC = '../lib';
}