[Moose-commits] r7297 - in Class-MOP/trunk: . t t/lib
t0m at code2.0beta.co.uk
t0m at code2.0beta.co.uk
Mon Jan 12 17:31:58 GMT 2009
Author: t0m
Date: 2009-01-12 09:31:58 -0800 (Mon, 12 Jan 2009)
New Revision: 7297
Added:
Class-MOP/trunk/t/306_is_class_loaded.t
Class-MOP/trunk/t/lib/TestClassLoaded.pm
Modified:
Class-MOP/trunk/Changes
Log:
TODO test showing differences between xs and pp versions of Class::MOP::is_class_loaded
Modified: Class-MOP/trunk/Changes
===================================================================
--- Class-MOP/trunk/Changes 2009-01-12 16:06:51 UTC (rev 7296)
+++ Class-MOP/trunk/Changes 2009-01-12 17:31:58 UTC (rev 7297)
@@ -1,5 +1,9 @@
Revision history for Perl extension Class-MOP.
+ * Tests
+ - Add test showing how the xs Class::MOP::is_class_loaded can
+ be made to operate differently to the pure perl version (t0m)
+
0.75 Wed, December 31, 2008
* Class::MOP::Class
- A class that was made immutable and then mutable could end up
Added: Class-MOP/trunk/t/306_is_class_loaded.t
===================================================================
--- Class-MOP/trunk/t/306_is_class_loaded.t (rev 0)
+++ Class-MOP/trunk/t/306_is_class_loaded.t 2009-01-12 17:31:58 UTC (rev 7297)
@@ -0,0 +1,25 @@
+use strict;
+use warnings;
+use FindBin qw/$Bin/;
+use lib "$Bin/lib";
+
+use Test::More tests => 1;
+use Class::MOP ();
+
+# Just defining this sub appears to shit in TestClassLoaded's symbol
+# tables (see the SCALAR package symbol you end up with).
+# This confuses the XS is_class_loaded method, which looks for _any_
+# symbol, not just code symbols of VERSION/AUTHORITY etc.
+
+sub fnar {
+ TestClassLoaded::this_method_does_not_even_exist()
+}
+
+Class::MOP::load_class('TestClassLoaded');
+
+TODO: {
+ local $TODO = 'Borked';
+ ok(TestClassLoaded->can('a_method'),
+ 'TestClassLoader::LoadedByLoader::a_method is defined');
+}
+
Added: Class-MOP/trunk/t/lib/TestClassLoaded.pm
===================================================================
--- Class-MOP/trunk/t/lib/TestClassLoaded.pm (rev 0)
+++ Class-MOP/trunk/t/lib/TestClassLoaded.pm 2009-01-12 17:31:58 UTC (rev 7297)
@@ -0,0 +1,8 @@
+package TestClassLoaded;
+use strict;
+use warnings;
+
+sub a_method { 'a_method' }
+
+1;
+
More information about the Moose-commits
mailing list