diff options
author | Larry Wall <lwall@jpl-devvax.jpl.nasa.gov> | 1990-03-27 04:46:23 +0000 |
---|---|---|
committer | Larry Wall <lwall@jpl-devvax.jpl.nasa.gov> | 1990-03-27 04:46:23 +0000 |
commit | 0f85fab05fafa513bd55a9e1ab280aac5567e27a (patch) | |
tree | 104b9667181305a6dce5f73bb4d23518f8ba0b2e /t | |
parent | b1248f16cd8cccfb12ae16cd8e7e93dd53dc52bf (diff) | |
download | perl-0f85fab05fafa513bd55a9e1ab280aac5567e27a.tar.gz |
perl 3.0 patch #18 patch #16, continued
See patch #16.
Diffstat (limited to 't')
-rw-r--r-- | t/op.dbm | 8 | ||||
-rw-r--r-- | t/op.range | 10 | ||||
-rw-r--r-- | t/op.subst | 2 | ||||
-rw-r--r-- | t/op.write | 46 |
4 files changed, 59 insertions, 7 deletions
@@ -1,13 +1,13 @@ #!./perl -# $Header: op.dbm,v 3.0 89/10/18 15:28:31 lwall Locked $ +# $Header: op.dbm,v 3.0.1.1 90/03/27 16:25:57 lwall Locked $ if (!-r '/usr/include/dbm.h' && !-r '/usr/include/ndbm.h') { print "1..0\n"; exit; } -print "1..9\n"; +print "1..10\n"; unlink 'Op.dbmx.dir', 'Op.dbmx.pag'; umask(0); @@ -92,4 +92,8 @@ print ($ok ? "ok 8\n" : "not ok 8\n"); $blksize,$blocks) = stat('Op.dbmx.pag'); print ($size > 0 ? "ok 9\n" : "not ok 9\n"); +@h{0..200} = 200..400; +@foo = @h{0..200}; +print join(':',200..400) eq join(':',@foo) ? "ok 10\n" : "no ok 10\n"; + unlink 'Op.dbmx.dir', 'Op.dbmx.pag'; diff --git a/t/op.range b/t/op.range index 4975c44441..d581b433cf 100644 --- a/t/op.range +++ b/t/op.range @@ -1,8 +1,8 @@ #!./perl -# $Header: op.range,v 3.0 89/10/18 15:30:53 lwall Locked $ +# $Header: op.range,v 3.0.1.1 90/03/27 16:27:58 lwall Locked $ -print "1..6\n"; +print "1..8\n"; print join(':',1..5) eq '1:2:3:4:5' ? "ok 1\n" : "not ok 1\n"; @@ -28,3 +28,9 @@ for ((100,2..99,1)) { $x += $_; } print $x == 5050 ? "ok 6\n" : "not ok 6 $x\n"; + +$x = join('','a'..'z'); +print $x eq 'abcdefghijklmnopqrstuvwxyz' ? "ok 7\n" : "not ok 7 $x\n"; + +@x = 'A'..'ZZ'; +print @x == 27 * 26 ? "ok 8\n" : "not ok 8\n"; diff --git a/t/op.subst b/t/op.subst index a3d45ea506..97ca2f8293 100644 --- a/t/op.subst +++ b/t/op.subst @@ -1,6 +1,6 @@ #!./perl -# $Header: op.subst,v 3.0.1.1 90/02/28 18:37:30 lwall Locked $ +# $Header: op.s,v 3.0.1.1 90/02/28 18:37:30 lwall Locked $ print "1..42\n"; diff --git a/t/op.write b/t/op.write index e1da85cc04..ef806da5b1 100644 --- a/t/op.write +++ b/t/op.write @@ -1,8 +1,8 @@ #!./perl -# $Header: op.write,v 3.0 89/10/18 15:32:16 lwall Locked $ +# $Header: op.write,v 3.0.1.1 90/03/27 16:29:00 lwall Locked $ -print "1..2\n"; +print "1..3\n"; format OUT = the quick brown @<< @@ -85,3 +85,45 @@ if (`cat Op.write.tmp` eq $right) else { print "not ok 2\n"; } +eval <<'EOFORMAT'; +format OUT2 = +the brown quick @<< +$fox +jumped +@* +$multiline +^<<<<<<<<< ~~ +$foo +now @<<the@>>>> for all@|||||men to come @<<<< +'i' . 's', "time\n", $good, 'to' +. +EOFORMAT + +open(OUT2, '>Op.write.tmp') || die "Can't create Op.write.tmp"; + +$fox = 'foxiness'; +$good = 'good'; +$multiline = "forescore\nand\nseven years\n"; +$foo = 'when in the course of human events it becomes necessary'; +write(OUT2); +close OUT2; + +$right = +"the brown quick fox +jumped +forescore +and +seven years +when in +the course +of human +events it +becomes +necessary +now is the time for all good men to come to\n"; + +if (`cat Op.write.tmp` eq $right) + { print "ok 3\n"; unlink 'Op.write.tmp'; } +else + { print "not ok 3\n"; } + |