summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/t/op/wantarray.t
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/t/op/wantarray.t')
-rw-r--r--gnu/usr.bin/perl/t/op/wantarray.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnu/usr.bin/perl/t/op/wantarray.t b/gnu/usr.bin/perl/t/op/wantarray.t
index 28936f419cc..350270d11c2 100644
--- a/gnu/usr.bin/perl/t/op/wantarray.t
+++ b/gnu/usr.bin/perl/t/op/wantarray.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..9\n";
+print "1..12\n";
sub context {
my ( $cona, $testnum ) = @_;
my $conb = (defined wantarray) ? ( wantarray ? 'A' : 'S' ) : 'V';
@@ -31,4 +31,14 @@ $a = scalar context('S',5);
print +($c == 2) ? "ok 9\n" : "not ok 9\t# <$c>\n";
}
+my $qcontext = q{
+ $q = (defined wantarray) ? ( wantarray ? 'A' : 'S' ) : 'V';
+};
+eval $qcontext;
+print $q eq 'V' ? "ok 10\n" : "not ok 10\n";
+$a = eval $qcontext;
+print $q eq 'S' ? "ok 11\n" : "not ok 11\n";
+@a = eval $qcontext;
+print $q eq 'A' ? "ok 12\n" : "not ok 12\n";
+
1;