diff options
author | Larry Wall <lwall@netlabs.com> | 1991-03-21 00:00:00 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1991-03-21 00:00:00 +0000 |
commit | fe14fcc35f78a371a174a1d14256c2f35ae4262b (patch) | |
tree | d472cb1055c47b9701cb0840969aacdbdbc9354a /t/op/do.t | |
parent | 27e2fb84680b9cc1db17238d5bf10b97626f477f (diff) | |
download | perl-fe14fcc35f78a371a174a1d14256c2f35ae4262b.tar.gz |
perl 4.0.00: (no release announcement available)perl-4.0.00
So far, 4.0 is still a beta test version. For the last production
version, look in pub/perl.3.0/kits@44.
Diffstat (limited to 't/op/do.t')
-rw-r--r-- | t/op/do.t | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/t/op/do.t b/t/op/do.t new file mode 100644 index 0000000000..f75ca3010e --- /dev/null +++ b/t/op/do.t @@ -0,0 +1,44 @@ +#!./perl + +# $Header: do.t,v 4.0 91/03/20 01:52:08 lwall Locked $ + +sub foo1 +{ + print $_[0]; + 'value'; +} + +sub foo2 +{ + shift(_); + print $_[0]; + $x = 'value'; + $x; +} + +print "1..15\n"; + +$_[0] = "not ok 1\n"; +$result = do foo1("ok 1\n"); +print "#2\t:$result: eq :value:\n"; +if ($result EQ 'value') { print "ok 2\n"; } else { print "not ok 2\n"; } +if ($_[0] EQ "not ok 1\n") { print "ok 3\n"; } else { print "not ok 3\n"; } + +$_[0] = "not ok 4\n"; +$result = do foo2("not ok 4\n","ok 4\n","not ok 4\n"); +print "#5\t:$result: eq :value:\n"; +if ($result EQ 'value') { print "ok 5\n"; } else { print "not ok 5\n"; } +if ($_[0] EQ "not ok 4\n") { print "ok 6\n"; } else { print "not ok 6\n"; } + +$result = do{print "ok 7\n"; 'value';}; +print "#8\t:$result: eq :value:\n"; +if ($result EQ 'value') { print "ok 8\n"; } else { print "not ok 8\n"; } + +sub blather { + print @_; +} + +do blather("ok 9\n","ok 10\n"); +@x = ("ok 11\n", "ok 12\n"); +@y = ("ok 14\n", "ok 15\n"); +do blather(@x,"ok 13\n",@y); |