summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNorton T. Allen <allen@huarp.harvard.edu>1998-02-18 06:19:54 -0500
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-02-20 12:49:09 +0000
commit1d0ef875ad68662c31346951eeba38d25948ba59 (patch)
treefa852e3d5116a3560b696477b1f25383b6858344 /t
parent4bfe01581aa86cc6e375a3342177d19e2538bd6c (diff)
downloadperl-1d0ef875ad68662c31346951eeba38d25948ba59.tar.gz
t/op/wantarray.t
p4raw-id: //depot/perl@555
Diffstat (limited to 't')
-rwxr-xr-xt/op/wantarray.t16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/op/wantarray.t b/t/op/wantarray.t
new file mode 100755
index 0000000000..0a47b6d3ba
--- /dev/null
+++ b/t/op/wantarray.t
@@ -0,0 +1,16 @@
+#!./perl
+
+print "1..3\n";
+sub context {
+ my ( $cona, $testnum ) = @_;
+ my $conb = (defined wantarray) ? ( wantarray ? 'A' : 'S' ) : 'V';
+ unless ( $cona eq $conb ) {
+ print "# Context $conb should be $cona\nnot ";
+ }
+ print "ok $testnum\n";
+}
+
+context('V',1);
+$a = context('S',2);
+@a = context('A',3);
+1;