11 ::ok($@, '... got an error because strict is on');
12 ::like($@, qr/Global symbol \"\$foo\" requires explicit package name at/, '... got the right error');
16 local $SIG{__WARN__} = sub { $warn = $_[0] };
18 ::ok(!$warn, '... no warning yet');
20 eval 'my $bar = 1 + "hello"';
22 ::ok($warn, '... got a warning');
23 ::like($warn, qr/Argument \"hello\" isn\'t numeric in addition \(\+\)/, '.. and it is the right warning');
29 ::ok(!$@, "... no error after no Moose");
33 local $SIG{__WARN__} = sub { $warn = $_[0] };
35 ::ok(!$warn, '... no warning yet');
37 eval 'my $bar = 1 + "hello"';
39 ::ok(!$warn, '... still no warning');
49 ::ok($@, '... got an error because strict is on');
50 ::like($@, qr/Global symbol \"\$foo\" requires explicit package name at/, '... got the right error');
54 local $SIG{__WARN__} = sub { $warn = $_[0] };
56 ::ok(!$warn, '... no warning yet');
58 eval 'my $bar = 1 + "hello"';
60 ::ok($warn, '... got a warning');
61 ::like($warn, qr/Argument \"hello\" isn\'t numeric in addition \(\+\)/, '.. and it is the right warning');
67 ::ok(!$@, "... no error after no Moose::Role");
71 local $SIG{__WARN__} = sub { $warn = $_[0] };
73 ::ok(!$warn, '... no warning yet');
75 eval 'my $bar = 1 + "hello"';
77 ::ok(!$warn, '... still no warning');
87 ::ok($@, '... got an error because strict is on');
88 ::like($@, qr/Global symbol \"\$foo2\" requires explicit package name at/, '... got the right error');
92 local $SIG{__WARN__} = sub { $warn = $_[0] };
94 ::ok(!$warn, '... no warning yet');
96 eval 'my $bar = 1 + "hello"';
98 ::ok($warn, '... got a warning');
99 ::like($warn, qr/Argument \"hello\" isn\'t numeric in addition \(\+\)/, '.. and it is the right warning');
105 ::ok(!$@, "... no error after no Moose::Exporter");
109 local $SIG{__WARN__} = sub { $warn = $_[0] };
111 ::ok(!$warn, '... no warning yet');
113 eval 'my $bar = 1 + "hello"';
115 ::ok(!$warn, '... still no warning');