summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/Module-Load-Conditional/t/01_Module_Load_Conditional.t
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2014-11-17 20:52:31 +0000
committerafresh1 <afresh1@openbsd.org>2014-11-17 20:52:31 +0000
commit6fb12b7054efc6b436584db6cef9c2f85c0d7e27 (patch)
treeaa09a524574ec7ae2f521a24573deeecb78ff66a /gnu/usr.bin/perl/cpan/Module-Load-Conditional/t/01_Module_Load_Conditional.t
parentAdd the Cammelia cipher to libcrypto. (diff)
downloadwireguard-openbsd-6fb12b7054efc6b436584db6cef9c2f85c0d7e27.tar.xz
wireguard-openbsd-6fb12b7054efc6b436584db6cef9c2f85c0d7e27.zip
Import perl-5.20.1
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Module-Load-Conditional/t/01_Module_Load_Conditional.t')
-rwxr-xr-xgnu/usr.bin/perl/cpan/Module-Load-Conditional/t/01_Module_Load_Conditional.t36
1 files changed, 32 insertions, 4 deletions
diff --git a/gnu/usr.bin/perl/cpan/Module-Load-Conditional/t/01_Module_Load_Conditional.t b/gnu/usr.bin/perl/cpan/Module-Load-Conditional/t/01_Module_Load_Conditional.t
index 99fa1fe72db..1bfa1a10d8f 100755
--- a/gnu/usr.bin/perl/cpan/Module-Load-Conditional/t/01_Module_Load_Conditional.t
+++ b/gnu/usr.bin/perl/cpan/Module-Load-Conditional/t/01_Module_Load_Conditional.t
@@ -234,6 +234,34 @@ use_ok( 'Module::Load::Conditional' );
);
}
+# test for autoload
+
+# autoload
+{
+ my $use_list = { 'AutoLoad' => 0 };
+ my $bool = can_load( modules => $use_list, autoload => 1 );
+ ok( $bool, q[autoloaded] );
+
+ eval { func1(); };
+ is( $@, '', q[exported function] );
+
+ eval { func2(); };
+ ok( $@, q[not exported function] );
+}
+
+# not autoload
+{
+ my $use_list = { 'NotAutoLoad' => 0 };
+ my $bool = can_load( modules => $use_list );
+ ok( $bool, q[not autoloaded] );
+
+ eval { func3(); };
+ ok( $@, q[not exported function - func3] );
+
+ eval { func4(); };
+ ok( $@, q[not exported function - func4] );
+}
+
### test 'requires' ###
SKIP:{
@@ -253,8 +281,8 @@ SKIP:{
local $Module::Load::Conditional::CHECK_INC_HASH = 1;
{ package A::B::C::D;
- $A::B::C::D::VERSION = $$;
- $INC{'A/B/C/D.pm'} = $$.$$;
+ $A::B::C::D::VERSION = "$$";
+ $INC{'A/B/C/D.pm'} = "$$"."$$";
### XXX this is no longer needed with M::Load 0.11_01
#$INC{'[.A.B.C]D.pm'} = $$.$$ if $^O eq 'VMS';
@@ -263,8 +291,8 @@ SKIP:{
my $href = check_install( module => 'A::B::C::D', version => 0 );
ok( $href, 'Found package in %INC' );
- is( $href->{'file'}, $$.$$, ' Found correct file' );
- is( $href->{'version'}, $$, ' Found correct version' );
+ is( $href->{'file'}, "$$"."$$", ' Found correct file' );
+ is( $href->{'version'}, "$$", ' Found correct version' );
ok( $href->{'uptodate'}, ' Marked as uptodate' );
ok( can_load( modules => { 'A::B::C::D' => 0 } ),
' can_load successful' );