[Bps-public-commit] r15116 - in Class-Require/trunk: t
sartak at bestpractical.com
sartak at bestpractical.com
Wed Aug 13 06:14:38 EDT 2008
Author: sartak
Date: Wed Aug 13 06:14:38 2008
New Revision: 15116
Modified:
Class-Require/trunk/ (props changed)
Class-Require/trunk/t/002-try-load-class.t
Class-Require/trunk/t/003-load-class.t
Log:
r69468 at onn: sartak | 2008-08-13 06:14:15 -0400
Ensure that is_class_loaded is used before trying to load a class
Modified: Class-Require/trunk/t/002-try-load-class.t
==============================================================================
--- Class-Require/trunk/t/002-try-load-class.t (original)
+++ Class-Require/trunk/t/002-try-load-class.t Wed Aug 13 06:14:38 2008
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More tests => 15;
+use Test::More tests => 16;
use Class::Require ':all';
use lib 't/lib';
@@ -27,3 +27,12 @@
ok(!is_class_loaded('Class::Require::Nonexistent'));
ok(!is_class_loaded('Class::Require::SyntaxError'));
+do {
+ package Class::Require::Inlined;
+ sub inlined { 1 }
+};
+
+ok(try_load_class('Class::Require::Inlined'), "loaded class Inlined");
+is($Class::Require::ERROR, undef);
+ok(is_class_loaded('Class::Require::Inlined'));
+
Modified: Class-Require/trunk/t/003-load-class.t
==============================================================================
--- Class-Require/trunk/t/003-load-class.t (original)
+++ Class-Require/trunk/t/003-load-class.t Wed Aug 13 06:14:38 2008
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More tests => 15;
+use Test::More tests => 16;
use Class::Require ':all';
use Test::Exception;
use lib 't/lib';
@@ -36,3 +36,12 @@
ok(!is_class_loaded('Class::Require::Nonexistent'));
ok(!is_class_loaded('Class::Require::SyntaxError'));
+do {
+ package Class::Require::Inlined;
+ sub inlined { 1 }
+};
+
+ok(load_class('Class::Require::Inlined'), "loaded class Inlined");
+is($Class::Require::ERROR, undef);
+ok(is_class_loaded('Class::Require::Inlined'));
+
More information about the Bps-public-commit
mailing list