| 1 | package Mason::t::LvalueAttributes; | ||
| 2 | 1 | $Mason::t::LvalueAttributes::VERSION = '2.24'; | |
| 3 | 1 | ▶ | use Test::Class::Most parent => 'Mason::Test::Class'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | __PACKAGE__->default_plugins( [ '@Default', 'LvalueAttributes' ] ); | |
| 6 | |||
| 7 | 1 | ▶ | sub test_lvalue : Tests { |
|
Subroutine
test_lvalue: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 8 | 1 | my $self = shift; | |
| 9 | 1 | $self->test_comp( | |
| 10 | src => ' | ||
| 11 | <%class> | ||
| 12 | has "a" => (is => "rw"); | ||
| 13 | has "b" => (is => "ro"); | ||
| 14 | |||
| 15 | </%class> | ||
| 16 | |||
| 17 | <%init> | ||
| 18 | $.a = 5; | ||
| 19 | print "a = " . $.a . "\n"; | ||
| 20 | $.a(6); | ||
| 21 | print "a = " . $.a . "\n"; | ||
| 22 | eval { $.b = 6 }; | ||
| 23 | print $@ . "\n"; | ||
| 24 | </%init> | ||
| 25 | ', | ||
| 26 | expect => qr/a = 5\na = 6\nCan't modify.*/, | ||
| 27 | ); | ||
| 28 | 1 | ▶ | } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 29 | |||
| 30 | 1 | 1; | |