diff options
author | Larry Wall <larry@netlabs.com> | 1993-11-10 00:00:00 +0000 |
---|---|---|
committer | Larry Wall <larry@netlabs.com> | 1993-11-10 00:00:00 +0000 |
commit | 463ee0b2acbd047c27e8b5393cdd8398881824c5 (patch) | |
tree | ae17d9179fc861ae5fc5a86da9139631530cb6fe /t/op | |
parent | 93a17b20b6d176db3f04f51a63b0a781e5ffd11c (diff) | |
download | perl-463ee0b2acbd047c27e8b5393cdd8398881824c5.tar.gz |
perl 5.0 alpha 4
[editor's note: the sparc executables have not been included, and
emacs backup files have been removed. This was reconstructed from a
tarball found on the September 1994 InfoMagic CD; the date of this is
approximate]
Diffstat (limited to 't/op')
-rwxr-xr-x | t/op/dbm.t | 10 | ||||
-rwxr-xr-x | t/op/ord.t | 4 | ||||
-rwxr-xr-x | t/op/sort.t | 6 | ||||
-rwxr-xr-x | t/op/time.t | 2 | ||||
-rwxr-xr-x | t/op/write.t | 2 |
5 files changed, 14 insertions, 10 deletions
diff --git a/t/op/dbm.t b/t/op/dbm.t index f09ca4febf..a011169865 100755 --- a/t/op/dbm.t +++ b/t/op/dbm.t @@ -10,11 +10,13 @@ if (!-r '/usr/include/dbm.h' && !-r '/usr/include/ndbm.h' print "1..12\n"; +init SDBM_File; + unlink <Op.dbmx.*>; unlink Op.dbmx; # in case we're running gdbm umask(0); -print (dbmopen(h,'Op.dbmx',0640) ? "ok 1\n" : "not ok 1\n"); +print (tie(%h,SDBM_File,'Op.dbmx', 0x202, 0640) ? "ok 1\n" : "not ok 1\n"); $Dfile = "Op.dbmx.pag"; if (! -e $Dfile) { @@ -24,7 +26,7 @@ if (! -e $Dfile) { ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, $blksize,$blocks) = stat($Dfile); print (($mode & 0777) == 0640 ? "ok 2\n" : "not ok 2\n"); -while (($key,$value) = each(h)) { +while (($key,$value) = each(%h)) { $i++; } print (!$i ? "ok 3\n" : "not ok 3\n"); @@ -48,8 +50,8 @@ $h{'i'} = 'I'; $h{'goner2'} = 'snork'; delete $h{'goner2'}; -dbmclose(h); -print (dbmopen(h,'Op.dbmx',0640) ? "ok 4\n" : "not ok 4\n"); +untie(%h); +print (tie(%h,SDBM_File,'Op.dbmx', 0x2, 0640) ? "ok 4\n" : "not ok 4\n"); $h{'j'} = 'J'; $h{'k'} = 'K'; diff --git a/t/op/ord.t b/t/op/ord.t index 67b8e24686..37128382d8 100755 --- a/t/op/ord.t +++ b/t/op/ord.t @@ -2,7 +2,7 @@ # $RCSfile: ord.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:09 $ -print "1..2\n"; +print "1..3\n"; # compile time evaluation @@ -12,3 +12,5 @@ if (ord('A') == 65) {print "ok 1\n";} else {print "not ok 1\n";} $x = 'ABC'; if (ord($x) == 65) {print "ok 2\n";} else {print "not ok 2\n";} + +if (chr 65 == A) {print "ok 3\n";} else {print "not ok 3\n";} diff --git a/t/op/sort.t b/t/op/sort.t index bf7a31759c..56a0fd3e92 100755 --- a/t/op/sort.t +++ b/t/op/sort.t @@ -4,7 +4,7 @@ print "1..10\n"; -sub reverse { $a lt $b ? 1 : $a gt $b ? -1 : 0; } +sub backwards { $a lt $b ? 1 : $a gt $b ? -1 : 0; } @harry = ('dog','cat','x','Cain','Abel'); @george = ('gone','chased','yz','Punished','Axed'); @@ -12,7 +12,7 @@ sub reverse { $a lt $b ? 1 : $a gt $b ? -1 : 0; } $x = join('', sort @harry); print ($x eq 'AbelCaincatdogx' ? "ok 1\n" : "not ok 1\n"); -$x = join('', sort reverse @harry); +$x = join('', sort backwards @harry); print ($x eq 'xdogcatCainAbel' ? "ok 2\n" : "not ok 2\n"); $x = join('', sort @george, 'to', @harry); @@ -42,7 +42,7 @@ print ("@b" eq "4 3 2 1" ? "ok 8\n" : "not ok 8 (@b)\n"); @b = sort {$a <=> $b;} @a; print ("@b" eq "2 3 4 10" ? "ok 9\n" : "not ok 9 (@b)\n"); -$sub = 'reverse'; +$sub = 'backwards'; $x = join('', sort $sub @harry); print ($x eq 'xdogcatCainAbel' ? "ok 10\n" : "not ok 10\n"); diff --git a/t/op/time.t b/t/op/time.t index 347592dab4..6d23832dfa 100755 --- a/t/op/time.t +++ b/t/op/time.t @@ -8,7 +8,7 @@ print "1..5\n"; $beg = time; -while (($now = time) == $beg) {} +while (($now = time) == $beg) { sleep 1 } if ($now > $beg && $now - $beg < 10){print "ok 1\n";} else {print "not ok 1\n";} diff --git a/t/op/write.t b/t/op/write.t index 35aba42eaa..eb00d81b59 100755 --- a/t/op/write.t +++ b/t/op/write.t @@ -57,7 +57,7 @@ now @<<the@>>>> for all@|||||men to come @<<<< 'i' . 's', "time\n", $good, 'to' . -open(OUT2, '>Op.write.tmp') || die "Can't create Op.write.tmp"; +open OUT2, '>Op.write.tmp' or die "Can't create Op.write.tmp"; $fox = 'foxiness'; $good = 'good'; |