This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add a note in perldelta about undefining *ISA
[perl5.git] / t / Module_Pluggable / 11usetwice.t
CommitLineData
3f7169a2
RGS
1#!perl -w
2
3use strict;
4use FindBin;
5use lib "$FindBin::Bin/lib";
6use Test::More tests => 3;
7
8my $foo;
9ok($foo = MyTest->new());
10
11my @plugins;
12my @expected = qw(MyTest::Extend::Plugin::Bar MyTest::Plugin::Bar MyTest::Plugin::Foo MyTest::Plugin::Quux::Foo);
13
14push @plugins, $foo->plugins;
15push @plugins, $foo->foo;
16
17@plugins = sort @plugins;
18is_deeply(\@plugins, \@expected);
19
20@plugins = ();
21
22push @plugins, MyTest->plugins;
23push @plugins, MyTest->foo;
24@plugins = sort @plugins;
25is_deeply(\@plugins, \@expected);
26
27
28
29package MyTest;
30
31use strict;
32use Module::Pluggable;
33use Module::Pluggable ( search_path => [ "MyTest::Extend::Plugin" ] , sub_name => 'foo' );
34
35
36sub new {
37 my $class = shift;
38 return bless {}, $class;
39
40}
41
42
431;
44