Fix a 5.70/5.80 behavior change in Catalyst::Utils::ensure_class_loaded, pointed...
[catagits/Catalyst-Runtime.git] / t / unit_utils_load_class.t
index 4231ba7..881b1ff 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 16;
+use Test::More tests => 18;
 use Class::MOP;
 
 use lib "t/lib";
@@ -66,3 +66,9 @@ undef $@;
 eval { Catalyst::Utils::ensure_class_loaded('Silly::File::Name.pm') };
 like($@, qr/Malformed class Name/, 'errored sanely when given a classname ending in .pm');
 
+undef $@;
+$warnings = 0;
+Catalyst::Utils::ensure_class_loaded("NullPackage");
+is( $warnings, 1, 'Loading a package which defines no symbols warns');
+is( $@, undef, '$@ still undef' );
+