summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-05-06 07:59:52 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-05-06 07:59:52 +0000
commit77d15e08bd6b0af0036d7f9174b760feccc7c797 (patch)
tree257e2e356c1b07f0e55a069ea63cfeff9dc6d77a /t
parent37d3ad2444e8ce4a246f544ed87418d87e284af4 (diff)
parent761b950803fe0721301dd94a6b797ce2ad9d805b (diff)
downloadperl-77d15e08bd6b0af0036d7f9174b760feccc7c797.tar.gz
Integrate from mainperl.
p4raw-id: //depot/cfgperl@3313
Diffstat (limited to 't')
-rwxr-xr-xt/lib/open3.t16
-rwxr-xr-xt/op/readdir.t6
-rwxr-xr-xt/pod/special_seqs.t2
-rw-r--r--t/pod/special_seqs.xr2
-rw-r--r--t/pod/testp2pt.pl29
5 files changed, 40 insertions, 15 deletions
diff --git a/t/lib/open3.t b/t/lib/open3.t
index 3a5d1c16df..7cd0ca306c 100755
--- a/t/lib/open3.t
+++ b/t/lib/open3.t
@@ -49,7 +49,7 @@ my ($pid, $reaped_pid);
STDOUT->autoflush;
STDERR->autoflush;
-print "1..21\n";
+print "1..22\n";
# basic
ok 1, $pid = open3 'WRITE', 'READ', 'ERROR', $perl, '-e', cmd_line(<<'EOF');
@@ -134,3 +134,17 @@ EOF
print WRITE "ok 20\n";
print WRITE "ok 21\n";
waitpid $pid, 0;
+
+# command line in single parameter variant of open3
+# for understanding of Config{'sh'} test see exec description in camel book
+my $cmd = 'print(scalar(<STDIN>))';
+$cmd = $Config{'sh'} =~ /sh/ ? "'$cmd'" : cmd_line($cmd);
+eval{$pid = open3 'WRITE', '>&STDOUT', 'ERROR', "$perl -e " . $cmd; };
+if ($@) {
+ print "error $@\n";
+ print "not ok 22\n";
+}
+else {
+ print WRITE "ok 22\n";
+ waitpid $pid, 0;
+}
diff --git a/t/op/readdir.t b/t/op/readdir.t
index ca19ebc7db..aea976823a 100755
--- a/t/op/readdir.t
+++ b/t/op/readdir.t
@@ -5,6 +5,12 @@ if ($@) { print "1..0\n"; exit; }
print "1..3\n";
+for $i (1..2000) {
+ local *OP;
+ opendir(OP, "op") or die "can't opendir: $!";
+ # should auto-closedir() here
+}
+
if (opendir(OP, "op")) { print "ok 1\n"; } else { print "not ok 1\n"; }
@D = grep(/^[^\.].*\.t$/i, readdir(OP));
closedir(OP);
diff --git a/t/pod/special_seqs.t b/t/pod/special_seqs.t
index 5352fd1ca6..1b31387dd3 100755
--- a/t/pod/special_seqs.t
+++ b/t/pod/special_seqs.t
@@ -27,4 +27,6 @@ too: C<$self-E<gt>method()> and C<$self-E<gt>{FIELDNAME}> and C<{FOO=E<gt>BAR}>.
Dont forget C<$self-E<gt>method()-E<gt>{FIELDNAME} = {FOO=E<gt>BAR}>.
+And make sure that C<0> works too!
+
=cut
diff --git a/t/pod/special_seqs.xr b/t/pod/special_seqs.xr
index b6ae7fd5b6..6795de0490 100644
--- a/t/pod/special_seqs.xr
+++ b/t/pod/special_seqs.xr
@@ -11,3 +11,5 @@
Dont forget `$self->method()->{FIELDNAME} = {FOO=>BAR}'.
+ And make sure that `0' works too!
+
diff --git a/t/pod/testp2pt.pl b/t/pod/testp2pt.pl
index 140de05a3a..9df5b9f2ed 100644
--- a/t/pod/testp2pt.pl
+++ b/t/pod/testp2pt.pl
@@ -3,8 +3,9 @@ package TestPodIncPlainText;
BEGIN {
use File::Basename;
use File::Spec;
+ use Cwd qw(abs_path);
push @INC, '..';
- my $THISDIR = dirname $0;
+ my $THISDIR = abs_path(dirname $0);
unshift @INC, $THISDIR;
require "testcmp.pl";
import TestCompare;
@@ -19,6 +20,7 @@ use vars qw(@ISA @EXPORT $MYPKG);
use Carp;
use Exporter;
#use File::Compare;
+#use Cwd qw(abs_path);
@ISA = qw(Pod::PlainText);
@EXPORT = qw(&testpodplaintext);
@@ -30,6 +32,16 @@ $MYPKG = eval { (caller)[0] };
sub catfile(@) { File::Spec->catfile(@_); }
+my $INSTDIR = abs_path(dirname $0);
+$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'xtra');
+$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'pod');
+$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 't');
+my @PODINCDIRS = ( catfile($INSTDIR, 'lib', 'Pod'),
+ catfile($INSTDIR, 'scripts'),
+ catfile($INSTDIR, 't', 'pod'),
+ catfile($INSTDIR, 't', 'pod', 'xtra')
+ );
+
## Find the path to the file to =include
sub findinclude {
my $self = shift;
@@ -42,19 +54,8 @@ sub findinclude {
## 1. the directory containing this pod file
my $thispoddir = dirname $self->input_file;
## 2. the parent directory of the above
- my $parentdir = ($thispoddir eq '.') ? '..' : dirname $thispoddir;
- ## 3. any Pod/ or scripts/ subdirectory of these two
- my @dirs = ();
- for ($thispoddir, $parentdir) {
- my $dir = $_;
- for ( qw(scripts lib) ) {
- push @dirs, $dir, catfile($dir, $_),
- catfile($dir, 'Pod'),
- catfile($dir, $_, 'Pod');
- }
- }
- my %dirs = (map { ($_ => 1) } @dirs);
- my @podincdirs = (sort keys %dirs);
+ my $parentdir = dirname $thispoddir;
+ my @podincdirs = ($thispoddir, $parentdir, @PODINCDIRS);
for (@podincdirs) {
my $incfile = catfile($_, $incname);