diff options
author | Sébastien Aperghis-Tramoni <sebastien@aperghis.net> | 2006-05-22 14:42:47 +0000 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2006-05-22 14:42:47 +0000 |
commit | 41b994da4e3577414d4dc63b509f70f6de8273bd (patch) | |
tree | f216a54932e4029f2b3fba06ac9479213006a7e9 /ext | |
parent | 3fe0558089b4b4d5d784b5fbc7024a901bee242e (diff) | |
download | perl-41b994da4e3577414d4dc63b509f70f6de8273bd.tar.gz |
Better handling for error-checking
From: IRC/#p5p/Maddingue (Sebastien Aperghis-Tramoni)
p4raw-id: //depot/perl@28274
Diffstat (limited to 'ext')
-rw-r--r-- | ext/DynaLoader/t/DynaLoader.t | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/DynaLoader/t/DynaLoader.t b/ext/DynaLoader/t/DynaLoader.t index ad8dc450db..841fa225db 100644 --- a/ext/DynaLoader/t/DynaLoader.t +++ b/ext/DynaLoader/t/DynaLoader.t @@ -9,6 +9,7 @@ BEGIN { use strict; use Config; +use Errno qw(ENOENT); use Test::More; my %modules; @@ -21,7 +22,7 @@ my %modules; 'Time::HiRes'=> q| ::is( ref Time::HiRes->can('usleep'),'CODE' ) |, # 5.7.3 ); -plan tests => 27 + keys(%modules) * 2; +plan tests => 28 + keys(%modules) * 2; # Try to load the module @@ -65,9 +66,9 @@ eval { no warnings 'uninitialized'; DynaLoader::dl_load_file(undef) }; is( $@, '', "calling DynaLoader::dl_load_file() with undefined argument" ); # is this expected ? eval { DynaLoader::dl_load_file("egg_bacon_sausage_and_spam") }; -is( $@, '', "calling DynaLoader::dl_load_file() with undefined argument" ); -like( DynaLoader::dl_error(), q{/egg_bacon_sausage_and_spam/}, - "calling DynaLoader::dl_load_file() with a package without binary object" ); +is( $@, '', "calling DynaLoader::dl_load_file() with a package without binary object" ); +is( 0+$!, ENOENT, "checking errno value" ); +like( DynaLoader::dl_error(), "/$!/", "checking error message returned by dl_error()" ); # ... dl_findfile() my @files = (); |