summaryrefslogtreecommitdiff
path: root/ext/DynaLoader/t/DynaLoader.t
diff options
context:
space:
mode:
authorChad Granum <chad.granum@dreamhost.com>2014-08-15 08:40:10 -0700
committerJames E Keenan <jkeenan@cpan.org>2014-08-16 23:19:29 +0200
commit6bdb88770f849c47b5c09e733ac460ce3e9dbc97 (patch)
tree3eda7f11aea1019f7a802c1caecfb81ab26e7761 /ext/DynaLoader/t/DynaLoader.t
parent7d16fb5f4895e672484c0b7490722d46df82b099 (diff)
downloadperl-6bdb88770f849c47b5c09e733ac460ce3e9dbc97.tar.gz
Update to include latest Test::Builder alpha
Also updated some tests that the new builder broke
Diffstat (limited to 'ext/DynaLoader/t/DynaLoader.t')
-rw-r--r--ext/DynaLoader/t/DynaLoader.t16
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/DynaLoader/t/DynaLoader.t b/ext/DynaLoader/t/DynaLoader.t
index ade1f8e52b..caf2e507f9 100644
--- a/ext/DynaLoader/t/DynaLoader.t
+++ b/ext/DynaLoader/t/DynaLoader.t
@@ -3,7 +3,7 @@
use strict;
use Config;
use Test::More;
-my %modules;
+my (%modules, %no_unload);
my $db_file;
BEGIN {
@@ -24,10 +24,16 @@ BEGIN {
$db_file => q| ::is( ref $db_file->can('TIEHASH'), 'CODE' ) |, # 5.0
'Socket' => q| ::is( ref Socket->can('inet_aton'),'CODE' ) |, # 5.0
'Time::HiRes'=> q| ::is( ref Time::HiRes->can('usleep'),'CODE' ) |, # 5.7.3
+ 'B' => q| ::is( ref B->can('svref_2object'),'CODE' ) |, # Test::Builder loads this.
+ 'Encode' => q| ::is( ref Encode->can('decode'),'CODE' ) |, # Test::Builder loads this.
);
-plan tests => 26 + keys(%modules) * 3;
-
+# These modules must not be unloaded since they are needed by Test::Builder
+%no_unload = (
+ 'B' => 1,
+ 'Encode' => 1,
+ 'List::Util' => 1,
+);
# Try to load the module
use_ok( 'DynaLoader' );
@@ -137,7 +143,6 @@ for my $module (sort keys %modules) {
}
}
-# checking internal consistency
is( scalar @DynaLoader::dl_librefs, scalar keys %modules, "checking number of items in \@dl_librefs" );
is( scalar @DynaLoader::dl_modules, scalar keys %modules, "checking number of items in \@dl_modules" );
@@ -150,6 +155,7 @@ for my $libref (reverse @DynaLoader::dl_librefs) {
skip "unloading unsupported on $^O", 2
if ($old_darwin || $^O eq 'VMS');
my $module = pop @loaded_modules;
+ next if $no_unload{$module};
skip "File::Glob sets PL_opfreehook", 2 if $module eq 'File::Glob';
my $r = eval { DynaLoader::dl_unload_file($libref) };
is( $@, '', "calling dl_unload_file() for $module" );
@@ -186,3 +192,5 @@ SKIP: {
"mod2fname + libname_unique correctly truncates long names"
);
}
+
+done_testing;