X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Fmy.t;h=601e1d6ae8d8a32e80ea56cc5516f39639e860f8;hb=95e8664e86da93255f26600f44bbbd70bf5b5b0e;hp=06c696353460752539e87bcc3195a1587c1fc503;hpb=a60067777be62ee91d1318f9ae26d9ed713245de;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/my.t b/t/op/my.t index 06c6963..601e1d6 100755 --- a/t/op/my.t +++ b/t/op/my.t @@ -2,7 +2,7 @@ # $RCSfile: my.t,v $ -print "1..28\n"; +print "1..31\n"; sub foo { my($a, $b) = @_; @@ -10,7 +10,8 @@ sub foo { my $d; $c = "ok 3\n"; $d = "ok 4\n"; - { my($a,$c) = ("ok 9\n", "ok 10\n"); ($x, $y) = ($a, $c); } + { my($a, undef, $c) = ("ok 9\n", "not ok 10\n", "ok 10\n"); + ($x, $y) = ($a, $c); } print $a, $b; $c . $d; } @@ -83,3 +84,18 @@ foreach my $i (26, 27) { print "not " if $i ne "outer"; print "ok 28\n"; + +# Ensure that C (without parens) doesn't force scalar context. +my @x; +{ @x = my @y } +print +(@x ? "not " : ""), "ok 29\n"; +{ @x = my %y } +print +(@x ? "not " : ""), "ok 30\n"; + +# Found in HTML::FormatPS +my %fonts = qw(nok 31); +for my $full (keys %fonts) { + $full =~ s/^n//; + # Supposed to be copy-on-write via force_normal after a THINKFIRST check. + print "$full $fonts{nok}\n"; +}