X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Fwantarray.t;h=350270d11c28271acd528cbd91e7157e58923f17;hb=bd7d4f4d586a396d1b104a293cce339c8d63ce5a;hp=28936f419cc80681edde3b99811fef7614101d00;hpb=d2ccd3cbfc4a43ae3c17071c87b4d721f3560ad6;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/wantarray.t b/t/op/wantarray.t index 28936f4..350270d 100755 --- a/t/op/wantarray.t +++ b/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;