This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix test warning: Use of uninitialized value
authorPali <pali@cpan.org>
Sun, 3 Dec 2017 16:42:14 +0000 (17:42 +0100)
committerTony Cook <tony@develop-help.com>
Mon, 15 Jan 2018 23:27:00 +0000 (10:27 +1100)
Function ok() compares values as strings which leads to stringification of
undef and throwing warning.

dist/Devel-PPPort/parts/inc/HvNAME

index 9b8602b..9fba502 100644 (file)
@@ -32,7 +32,7 @@ HvNAMELEN_get(hv)
 =tests plan => 4
 
 ok(Devel::PPPort::HvNAME_get(\%Devel::PPPort::), 'Devel::PPPort');
-ok(Devel::PPPort::HvNAME_get({}), undef);
+ok(!defined Devel::PPPort::HvNAME_get({}));
 
 ok(Devel::PPPort::HvNAMELEN_get(\%Devel::PPPort::), length('Devel::PPPort'));
 ok(Devel::PPPort::HvNAMELEN_get({}), 0);