X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Fmy.t;h=6feabe4e0a48191e266287e5df8940e2efc171c8;hb=bd7d4f4d586a396d1b104a293cce339c8d63ce5a;hp=1777e88266bc07d572f7e9bcd5a39f08708084e2;hpb=dab48698179b4e8606409875b7121f225bcf46be;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/my.t b/t/op/my.t index 1777e88..6feabe4 100755 --- a/t/op/my.t +++ b/t/op/my.t @@ -2,7 +2,7 @@ # $RCSfile: my.t,v $ -print "1..30\n"; +print "1..34\n"; sub foo { my($a, $b) = @_; @@ -92,3 +92,33 @@ 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"; +} + +# [perl #29340] optimising away the = () left the padav returning the +# array rather than the contents, leading to 'Bizarre copy of array' error + +sub opta { my @a=() } +sub opth { my %h=() } +eval { my $x = opta }; +print "not " if $@; +print "ok 32\n"; +eval { my $x = opth }; +print "not " if $@; +print "ok 33\n"; + + +sub foo3 { + ++my $x->{foo}; + print "not " if defined $x->{bar}; + ++$x->{bar}; +} +eval { foo3(); foo3(); }; +print "not " if $@; +print "ok 34\n"; +