t/10-good.t
t/20-bad.t
t/21-bad-fatal.t
+t/22-bad-mixed.t
t/30-scope.t
t/90-boilerplate.t
t/91-pod.t
#!perl -T
+package Dongs;
+
+sub new;
+
+package main;
+
use strict;
use warnings;
-use Test::More tests => 36 * 2;
+use Test::More tests => 36 * 4;
my ($obj, $pkg, $cb, $x);
sub meh;
local $/ = "####\n";
while (<DATA>) {
chomp;
+ local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
{
use indirect;
- local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
eval "die qq{ok\\n}; $_";
}
- is($@, "ok\n", $_);
+ is($@, "ok\n", "use indirect: $_");
{
no indirect;
- local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
eval "die qq{ok\n}; $_";
}
- is($@, "ok\n", $_);
+ is($@, "ok\n", "no indirect: $_");
+ s/Hlagh/Dongs/g;
+ {
+ use indirect;
+ eval "die qq{ok\\n}; $_";
+ }
+ is($@, "ok\n", "use indirect, defined: $_");
+ {
+ no indirect;
+ eval "die qq{ok\\n}; $_";
+ }
+ is($@, "ok\n", "no indirect, defined: $_");
}
}
#!perl -T
+package Dongs;
+
+sub new;
+
+package main;
+
use strict;
use warnings;
-use Test::More tests => 30 * 2 + 2;
+use Test::More tests => 33 * 4 + 2;
my ($obj, $x);
local $/ = "####\n";
while (<DATA>) {
chomp;
+ local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
+ {
+ use indirect;
+ eval "die qq{ok\\n}; $_";
+ }
+ is($@, "ok\n", "use indirect: $_");
+ {
+ no indirect;
+ eval "die qq{the code compiled but it shouldn't have\n}; $_";
+ }
+ like($@, qr/^warn:Indirect\s+call\s+of\s+method\s+"(?:new|meh|HlaghHlagh)"\s+on\s+object\s+"(?:Hlagh|newnew|\$x|\$_)"/, "no indirect: $_");
+ s/Hlagh/Dongs/g;
{
use indirect;
- local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
eval "die qq{ok\\n}; $_";
}
- is($@, "ok\n", $_);
+ is($@, "ok\n", "use indirect, defined: $_");
{
no indirect;
- local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
eval "die qq{the code compiled but it shouldn't have\n}; $_";
}
- like($@, qr/^warn:Indirect\s+call\s+of\s+method\s+"(?:new|meh|HlaghHlagh)"\s+on\s+object\s+"(?:Hlagh|newnew|\$x|\$_)"/, $_);
+ like($@, qr/^warn:Indirect\s+call\s+of\s+method\s+"(?:new|meh|DongsDongs)"\s+on\s+object\s+"(?:Dongs|newnew|\$x|\$_)"/, "no indirect, defined: $_");
}
}
####
meh $x, 1, 2;
####
+new Hlagh->wut;
+####
+new Hlagh->wut();
+####
+new Hlagh->wut, "Wut";
+####
$obj = HlaghHlagh Hlagh;
####
$obj = HlaghHlagh Hlagh; # HlaghHlagh Hlagh
--- /dev/null
+#!perl -T
+
+package Dongs;
+
+sub new;
+
+package main;
+
+use strict;
+use warnings;
+
+use Test::More tests => 3 * 4;
+
+sub meh;
+
+{
+ local $/ = "####\n";
+ while (<DATA>) {
+ chomp;
+ local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
+ {
+ use indirect;
+ eval "die qq{ok\\n}; $_";
+ }
+ is($@, "ok\n", "use indirect: $_");
+ {
+ no indirect;
+ eval "die qq{ok\n}; $_";
+ }
+ is($@, "ok\n", "no indirect: $_");
+ s/Hlagh/Dongs/g;
+ {
+ use indirect;
+ eval "die qq{ok\\n}; $_";
+ }
+ is($@, "ok\n", "use indirect, defined: $_");
+ {
+ no indirect;
+ eval "die qq{the code compiled but it shouldn't have\n}; $_";
+ }
+ like($@, qr/^warn:Indirect\s+call\s+of\s+method\s+"meh"\s+on\s+object\s+"Dongs"/, "no indirect, defined: $_");
+ }
+}
+
+__DATA__
+meh Hlagh->new;
+####
+meh Hlagh->new();
+####
+meh Hlagh->new, "Wut";