Commit | Line | Data |
89f74416 |
1 | use strict; |
2 | use warnings; |
89f74416 |
3 | |
8db4963b |
4 | use FindBin qw/$Bin/; |
5 | use lib "$Bin/lib"; |
6 | |
7699d177 |
7 | use Test::More; |
89f74416 |
8 | use Class::MOP (); |
9 | |
7699d177 |
10 | plan 'skip_all' => 'This test is only meaningful for an XS-enabled CMOP with Perl < 5.10' |
f6db4612 |
11 | if Class::MOP::IS_RUNNING_ON_5_10() || ! Class::MOP::USING_XS(); |
12 | |
89f74416 |
13 | |
7699d177 |
14 | plan tests => 1; |
15 | |
16 | # With pre-5.10 Perl, just defining this sub appears to shit in |
17 | # TestClassLoaded's symbol tables (see the SCALAR package symbol you |
18 | # end up with). This confuses the XS is_class_loaded method, which |
19 | # looks for _any_ symbol, not just code symbols of VERSION/AUTHORITY |
20 | # etc. |
21 | |
22 | sub whatever { |
b39d2247 |
23 | TestClassLoaded::this_method_does_not_even_exist(); |
89f74416 |
24 | } |
25 | |
26 | Class::MOP::load_class('TestClassLoaded'); |
27 | |
28 | TODO: { |
7699d177 |
29 | local $TODO = 'The XS is_class_loaded is confused by the bogus method defined in whatever()'; |
b39d2247 |
30 | ok( |
31 | TestClassLoaded->can('a_method'), |
32 | 'TestClassLoader::a_method is defined' |
33 | ); |
89f74416 |
34 | } |
35 | |