diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-02-03 13:50:23 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-02-03 13:50:23 +0000 |
commit | cff038c093b1e26725739ab3ab28950b8fe37d7d (patch) | |
tree | 05693a975af81eea63183e17d751e3689c450d63 /t | |
parent | e7f07268aa53c62dd99727c5a996618d28697a90 (diff) | |
parent | 93bce2dcd9a377cf8ad779ab0e9115bcce1265d2 (diff) | |
download | perl-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/harness | 1 | ||||
-rwxr-xr-x | t/op/avhv.t | 29 | ||||
-rwxr-xr-x | t/op/push.t | 3 |
3 files changed, 26 insertions, 7 deletions
@@ -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 |