Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Class-Inspector CPAN distribution.

Report information
The Basics
Id: 19964
Status: resolved
Priority: 0/
Queue: Class-Inspector

People
Owner: Nobody in particular
Requestors: jguenther [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.15
Fixed in: (no value)



Subject: Class::Inspector->loaded returns true when a class has syntax errors
Class::Inspector->loaded detects packages with syntax errors as being loaded. Test case: # in file Class/Inspector/_ErrorPackage.pm package Class::Inspector::_ErrorPackage; my $blah ''; #syntax error 1; # file t/03_loaded.t #!/usr/bin/perl use Test::More tests => 2; use Class::Inspector; use lib 't/lib'; my $class = 'Class::Inspector::_ErrorPackage'; ok( ! Class::Inspector->loaded($class), 'ErrorPackage not loaded yet' ); { # swallow warnings local $SIG{__WARN__} = sub { my $warn = shift; warn $warn unless ($warn =~ /String found where operator expected/ or $warn =~ /Missing operator before/); }; eval "require $class"; } ok( ! Class::Inspector->loaded($class), 'ErrorPackage not loaded after error' ); #fails
From what I can see, this is correct behavior, because you intentionally suppressed the build errors with the eval { }... The module partly loaded, correctly.