make make_patchnum.sh (more) portable
[p5sagit/p5-mst-13.2.git] / t / Module_Pluggable / 02works_taint.t
1 #!perl -wT
2
3 # NOTE: Module::Pluggable is going into core
4 # and CORE tests can't modify @INC under taint 
5 # so this is a work around to make sure it
6 # still works under taint checking.
7
8 use strict;
9 use Test::More tests => 5;
10
11 my $foo;
12 ok($foo = MyTest->new());
13
14 my @plugins;
15 my @expected = qw(Module::Pluggable::Object);
16 ok(@plugins = sort $foo->plugins);
17
18
19 ok(grep {/Module::Pluggable::Object/} @plugins, "Contains Module::Pluggable::Object");
20
21 @plugins = ();
22
23 ok(@plugins = sort MyTest->plugins);
24
25 ok(grep {/Module::Pluggable::Object/} @plugins, "Contains Module::Pluggable::Object under class method");
26
27
28
29 package MyTest;
30
31 use strict;
32 use Module::Pluggable search_path => 'Module::Pluggable';
33
34
35 sub new {
36     my $class = shift;
37     return bless {}, $class;
38
39 }
40 1;
41