From: Tomas Doran Date: Mon, 12 Jan 2009 17:31:58 +0000 (+0000) Subject: TODO test showing differences between xs and pp versions of Class::MOP::is_class_loaded X-Git-Tag: 0.76~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=89f74416d658c035e3b730c953777c22e3346e86;p=gitmo%2FClass-MOP.git TODO test showing differences between xs and pp versions of Class::MOP::is_class_loaded --- diff --git a/Changes b/Changes index cdc8a24..8d18dce 100644 --- a/Changes +++ b/Changes @@ -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 diff --git a/t/306_is_class_loaded.t b/t/306_is_class_loaded.t new file mode 100644 index 0000000..38ca6a1 --- /dev/null +++ b/t/306_is_class_loaded.t @@ -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'); +} + diff --git a/t/lib/TestClassLoaded.pm b/t/lib/TestClassLoaded.pm new file mode 100644 index 0000000..8e89f10 --- /dev/null +++ b/t/lib/TestClassLoaded.pm @@ -0,0 +1,8 @@ +package TestClassLoaded; +use strict; +use warnings; + +sub a_method { 'a_method' } + +1; +