6 use Test::More tests => 4;
8 sub Str::TYPEDSCALAR { }
10 sub Str1::TYPEDSCALAR {
15 sub Str2::TYPEDSCALAR {
21 my ($file, $line) = map quotemeta, @_;
22 $file = '\\(eval \\d+\\)' unless $file;
23 return qr/^Modification of a read-only value attempted at $file line $line/;
27 diag 'This will throw two warnings' if $] >= 5.008008 and $] < 5.009;
34 use Lexical::Types as => sub { $_[0] = 'dongs'; () };
37 like $@, ro_re('', 2), '$_[0] in initializer is read only';
41 skip 'Kinda broken on old 5.8.x' => 1 if $] <= 5.008006;
45 use Lexical::Types as => sub { $_[1] = 'hlagh'; () };
48 like $@, ro_re('', 2), '$_[1] in initializer is read only';
57 like $@, ro_re($0, 11), '$_[0] in initializer is read only';
66 like $@, ro_re($0, 16), '$_[2] in initializer is read only';