This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Module::Pluggable 3.7
[perl5.git] / t / Module_Pluggable / 16different_extension.t
1 #!perl -w
2
3 use strict;
4 use FindBin;
5 use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
6 use Test::More tests => 5;
7
8 my $foo;
9 ok($foo = ExtTest->new());
10
11 my @plugins;
12 my @expected = qw(ExtTest::Plugin::Bar ExtTest::Plugin::Foo ExtTest::Plugin::Quux::Foo);
13 ok(@plugins = sort $foo->plugins);
14
15
16
17 is_deeply(\@plugins, \@expected, "is deeply");
18
19 @plugins = ();
20
21 ok(@plugins = sort ExtTest->plugins);
22
23
24
25
26 is_deeply(\@plugins, \@expected, "is deeply class");
27
28
29
30 package ExtTest;
31
32 use strict;
33 use Module::Pluggable file_regex => qr/\.plugin$/;
34
35
36 sub new {
37     my $class = shift;
38     return bless {}, $class;
39
40 }
41 1;
42