6 use Test::More tests => 30 * 2;
16 local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
17 eval "die qq{ok\\n}; $_";
22 local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
23 eval "die qq{the code compiled but it shouldn't have\n}; $_";
25 like($@, qr/^warn:Indirect\s+call\s+of\s+method\s+"(?:new|meh|HlaghHlagh)"\s+on\s+object\s+"(?:Hlagh|newnew|\$x|\$_)"/, $_);
36 $obj = new Hlagh(1, 2);
40 $obj = new Hlagh ( ) ;
42 $obj = new Hlagh ( 1 ) ;
44 $obj = new Hlagh ( 1 , 2 ) ;
71 $obj = new $x qq{foo}, 1;
73 $obj = new $x qr{foo\s+bar}, 1 .. 1;
75 $obj = new $x(qw/bar baz/);
83 $obj = new $_ qr/foo/ ;
85 $obj = new $_ qq(bar baz);
91 $obj = HlaghHlagh Hlagh;
93 $obj = HlaghHlagh Hlagh; # HlaghHlagh Hlagh
97 $obj = new newnew; # new newnew