-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
179 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
use B (); | ||
|
||
use Devel::Isa::Explainer (); | ||
|
||
*extract_mro = \&Devel::Isa::Explainer::_extract_mro; | ||
{ | ||
my $mro = extract_mro("B"); | ||
my $fail = 0; | ||
for my $class ( @{$mro} ) { | ||
next unless $class->{class} eq 'B'; | ||
$fail = 1 unless ok( exists $class->{subs}->{'svref_2object'}, "svref_2object discovered in class" ); | ||
$fail = 1 unless ok( $class->{subs}->{'svref_2object'}->{xsub}, "svref_2object is an XSUB" ); | ||
} | ||
diag explain $mro if $fail; | ||
|
||
} | ||
{ | ||
my $mro = extract_mro("Devel::Isa::Explainer"); | ||
my $fail = 0; | ||
for my $class ( @{$mro} ) { | ||
next unless $class->{class} eq 'Devel::Isa::Explainer'; | ||
$fail = 1 unless ok( exists $class->{subs}->{'explain_isa'}, "explain_isa discovered in class" ); | ||
$fail = 1 unless ok( !$class->{subs}->{'explain_isa'}->{xsub}, "explain_isa is NOT an XSUB" ); | ||
} | ||
diag explain $mro if $fail; | ||
} | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
{ | ||
package My::Test; | ||
sub constant_sub() { 'Hello' } | ||
} | ||
use Devel::Isa::Explainer (); | ||
|
||
*extract_mro = \&Devel::Isa::Explainer::_extract_mro; | ||
{ | ||
my $mro = extract_mro("My::Test"); | ||
my $fail = 0; | ||
for my $class ( @{$mro} ) { | ||
next unless $class->{class} eq 'My::Test'; | ||
$fail = 1 unless ok( exists $class->{subs}->{'constant_sub'}, "constant_sub discovered in class" ); | ||
$fail = 1 unless ok( $class->{subs}->{'constant_sub'}->{constant}, "constant_sub is a constant sub" ); | ||
} | ||
diag explain $mro if $fail; | ||
|
||
} | ||
{ | ||
my $mro = extract_mro("Devel::Isa::Explainer"); | ||
my $fail = 0; | ||
for my $class ( @{$mro} ) { | ||
next unless $class->{class} eq 'Devel::Isa::Explainer'; | ||
$fail = 1 unless ok( exists $class->{subs}->{'explain_isa'}, "explain_isa discovered in class" ); | ||
$fail = 1 unless ok( !$class->{subs}->{'explain_isa'}->{constant}, "explain_isa is NOT a constant sub" ); | ||
} | ||
diag explain $mro if $fail; | ||
} | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
use B qw(); | ||
{ | ||
package My::Test; | ||
sub constant_sub() { 'Hello' } | ||
BEGIN { | ||
bless \&My::Test::constant_sub, 'My::Test'; | ||
*My::Test::xsub = \&B::svref_2object; | ||
bless \&My::Test::xsub, 'B'; | ||
}; | ||
} | ||
|
||
use Devel::Isa::Explainer (); | ||
|
||
*extract_mro = \&Devel::Isa::Explainer::_extract_mro; | ||
{ | ||
my $mro = extract_mro("My::Test"); | ||
my $fail = 0; | ||
for my $class ( @{$mro} ) { | ||
next unless $class->{class} eq 'My::Test'; | ||
$fail = 1 unless ok( exists $class->{subs}->{'constant_sub'}, "constant_sub discovered in class" ); | ||
$fail = 1 unless ok( $class->{subs}->{'constant_sub'}->{constant}, "constant_sub is a constant sub" ); | ||
$fail = 1 unless ok( exists $class->{subs}->{'xsub'}, "xsub discovered in class" ); | ||
$fail = 1 unless ok( $class->{subs}->{'xsub'}->{xsub}, "xsub is an XSUB" ); | ||
} | ||
diag explain $mro if $fail; | ||
|
||
} | ||
done_testing; |