~ubuntu-branches/ubuntu/precise/perl/precise

« back to all changes in this revision

Viewing changes to t/op/sub_lval.t

  • Committer: Bazaar Package Importer
  • Author(s): Niko Tyni
  • Date: 2011-02-06 11:31:38 UTC
  • mto: (8.2.12 experimental) (1.1.12)
  • mto: This revision was merged to the branch mainline in revision 46.
  • Revision ID: james.westby@ubuntu.com-20110206113138-lzpm3g6rur7i3eyp
Tags: upstream-5.12.3
ImportĀ upstreamĀ versionĀ 5.12.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
    @INC = '../lib';
4
4
    require './test.pl';
5
5
}
6
 
plan tests=>71;
 
6
plan tests=>73;
7
7
 
8
8
sub a : lvalue { my $a = 34; ${\(bless \$a)} }  # Return a temporary
9
9
sub b : lvalue { ${\shift} }
570
570
    lval_decl = 5;
571
571
    is($x, 5, "subroutine declared with lvalue before definition retains lvalue. [perl #68758]");
572
572
}
 
573
 
 
574
sub fleen : lvalue { $pnare }
 
575
$pnare = __PACKAGE__;
 
576
ok eval { fleen = 1 }, "lvalues can return COWs (CATTLE?) [perl #75656]";\
 
577
is $pnare, 1, 'and returning CATTLE actually works';