This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
charnames.t: Guard agains empty lines in __DATA__
authorKarl Williamson <public@khwilliamson.com>
Mon, 2 Aug 2010 22:36:51 +0000 (16:36 -0600)
committerRafael Garcia-Suarez <rgs@consttype.org>
Fri, 13 Aug 2010 12:36:20 +0000 (14:36 +0200)
Somehow an empty line got inserted at the end of the file, and got
interpreted as 0's which caused the test for NULL to fail.  This guards
against that.

I removed the empty line, but I'm not sure git has picked that up.

lib/charnames.t

index a77fec2..f41d5a3 100644 (file)
@@ -850,6 +850,7 @@ is("\N{U+1D0C5}", "\N{BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON CHROMA VASIS}");
     # from the web.
     while (<DATA>) {
         chomp;
+        next unless $_;     # Guard against empty lines getting inserted.
         my ($code, $name) = split ";";
         my $decimal = hex $code;
         $names[$decimal] = $name;