Allow file globbing in preload.exclude
This commit is contained in:
parent
7c240127e8
commit
1db4a7f916
3 changed files with 34 additions and 4 deletions
|
|
@ -41,7 +41,7 @@ use WebGUI::Pluggable;
|
|||
#----------------------------------------------------------------------------
|
||||
# Tests
|
||||
|
||||
plan tests => 8; # Increment this number for each test you create
|
||||
plan tests => 11; # Increment this number for each test you create
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# put your tests here
|
||||
|
|
@ -82,7 +82,7 @@ is($dumper->Dump, q|$VAR1 = {
|
|||
},
|
||||
File::Spec->catfile( $lib, 'WebGUI', 'i18n' ),
|
||||
);
|
||||
|
||||
|
||||
cmp_deeply(
|
||||
[ WebGUI::Pluggable::find( 'WebGUI::i18n' ) ],
|
||||
bag( @testFiles ),
|
||||
|
|
@ -100,7 +100,30 @@ is($dumper->Dump, q|$VAR1 = {
|
|||
bag( grep { $_ ne 'WebGUI::i18n::English::WebGUI' } @testFiles ),
|
||||
"find() with exclude",
|
||||
);
|
||||
|
||||
|
||||
cmp_deeply(
|
||||
[ WebGUI::Pluggable::find( 'WebGUI::i18n', { exclude => [ 'WebGUI::i18n::English::WebGUI*' ] } ) ],
|
||||
bag( grep { $_ ne 'WebGUI::i18n::English::WebGUI' || $_ ne 'WebGUI::i18n::English::WebGUIProfile' } @testFiles ),
|
||||
"find() with exclude with glob",
|
||||
);
|
||||
|
||||
cmp_deeply(
|
||||
[ WebGUI::Pluggable::find( 'WebGUI::i18n', { exclude => [ 'WebGUI::i18n::English::WebGUI.*' ] } ) ],
|
||||
bag( grep { $_ ne 'WebGUI::i18n::English::WebGUI' || $_ ne 'WebGUI::i18n::English::WebGUIProfile' } @testFiles ),
|
||||
"find() with exclude with regex",
|
||||
);
|
||||
|
||||
cmp_deeply(
|
||||
[ WebGUI::Pluggable::find( 'WebGUI::i18n', { exclude => [ qw/WebGUI::i18n::English::WebGUI.* WebGUI::i18n::English::ShipDriver_USPS*/ ] } ) ],
|
||||
bag( grep {
|
||||
$_ ne 'WebGUI::i18n::English::WebGUI'
|
||||
|| $_ ne 'WebGUI::i18n::English::WebGUIProfile'
|
||||
|| $_ ne 'WebGUI::i18n::English::ShipDriver_USPS'
|
||||
|| $_ ne 'WebGUI::i18n::English::ShipDriver_USPSInternational'
|
||||
} @testFiles ),
|
||||
"find() with multiple excludes",
|
||||
);
|
||||
|
||||
cmp_deeply(
|
||||
[ WebGUI::Pluggable::find( 'WebGUI::i18n', { onelevel => 1, return => "name" } ) ],
|
||||
bag( map { /::([^:]+)$/; $1 } grep { /^WebGUI::i18n::[^:]+$/ } @testFiles ),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue