summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-02-03 13:50:23 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-02-03 13:50:23 +0000
commitcff038c093b1e26725739ab3ab28950b8fe37d7d (patch)
tree05693a975af81eea63183e17d751e3689c450d63 /t
parente7f07268aa53c62dd99727c5a996618d28697a90 (diff)
parent93bce2dcd9a377cf8ad779ab0e9115bcce1265d2 (diff)
downloadperl-cff038c093b1e26725739ab3ab28950b8fe37d7d.tar.gz
Integrate win32 into mainline. My last integration from ansiperl
to the mainline was a dismal failure: I did -ay but meant -at. This should fix things now since win32 has already integrated all the necessary changes from ansiperl. p4raw-id: //depot/perl@457
Diffstat (limited to 't')
-rw-r--r--t/harness1
-rwxr-xr-xt/op/avhv.t29
-rwxr-xr-xt/op/push.t3
3 files changed, 26 insertions, 7 deletions
diff --git a/t/harness b/t/harness
index fe64a04629..af92a8b6dc 100644
--- a/t/harness
+++ b/t/harness
@@ -6,6 +6,7 @@
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
+ $ENV{PERL5LIB} = '../lib'; # so children will see it too
}
use lib '../lib';
diff --git a/t/op/avhv.t b/t/op/avhv.t
index 0390429d2b..a7ce58ab87 100755
--- a/t/op/avhv.t
+++ b/t/op/avhv.t
@@ -1,13 +1,23 @@
#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+require Tie::Array;
-package Tie::StdArray;
+package Tie::BasicArray;
+@ISA = 'Tie::Array';
sub TIEARRAY { bless [], $_[0] }
-sub STORE { $_[0]->[$_[1]] = $_[2] }
-sub FETCH { $_[0]->[$_[1]] }
+sub STORE { $_[0]->[$_[1]] = $_[2] }
+sub FETCH { $_[0]->[$_[1]] }
+sub FETCHSIZE { scalar(@{$_[0]})}
+sub STORESIZE { $#{$_[0]} = $_[1]+1 }
package main;
-print "1..4\n";
+print "1..5\n";
$sch = {
'abc' => 1,
@@ -48,12 +58,19 @@ $a->[0] = $sch;
$a->{'abc'} = 'ABC';
if ($a->{'abc'} eq 'ABC') {print "ok 3\n";} else {print "not ok 3\n";}
+# quick check with tied array
+tie @fake, 'Tie::BasicArray';
+$a = \@fake;
+$a->[0] = $sch;
+
+$a->{'abc'} = 'ABC';
+if ($a->{'abc'} eq 'ABC') {print "ok 4\n";} else {print "not ok 4\n";}
+
# quick check with tied array & tied hash
-@INC = ("./lib", "../lib");
require Tie::Hash;
tie %fake, Tie::StdHash;
%fake = %$sch;
$a->[0] = \%fake;
$a->{'abc'} = 'ABC';
-if ($a->{'abc'} eq 'ABC') {print "ok 4\n";} else {print "not ok 4\n";}
+if ($a->{'abc'} eq 'ABC') {print "ok 5\n";} else {print "not ok 5\n";}
diff --git a/t/op/push.t b/t/op/push.t
index 68fab66af7..f62a4e9d8e 100755
--- a/t/op/push.t
+++ b/t/op/push.t
@@ -22,7 +22,7 @@ die "blech" unless @tests;
@x = (1,2,3);
push(@x,@x);
if (join(':',@x) eq '1:2:3:1:2:3') {print "ok 1\n";} else {print "not ok 1\n";}
-push(x,4);
+push(@x,4);
if (join(':',@x) eq '1:2:3:1:2:3:4') {print "ok 2\n";} else {print "not ok 2\n";}
$test = 3;
@@ -47,3 +47,4 @@ foreach $line (@tests) {
}
}
+1; # this file is require'd by lib/tie-stdpush.t