[Rt-commit] r5341 - in Text-Tags: lib/Text/Tags

glasser at bestpractical.com glasser at bestpractical.com
Tue Jun 6 14:04:44 EDT 2006


Author: glasser
Date: Tue Jun  6 14:04:43 2006
New Revision: 5341

Modified:
   Text-Tags/lib/Text/Tags/Parser.pm
   Text-Tags/t/01.parse.t

Log:
Instead of throwing warnings when passed undef, just return undef.

Modified: Text-Tags/lib/Text/Tags/Parser.pm
==============================================================================
--- Text-Tags/lib/Text/Tags/Parser.pm	(original)
+++ Text-Tags/lib/Text/Tags/Parser.pm	Tue Jun  6 14:04:43 2006
@@ -12,6 +12,8 @@
     my $self   = shift;
     my $string = shift;
 
+    return unless defined $string;
+
     my @tags;
     my %seen;
 

Modified: Text-Tags/t/01.parse.t
==============================================================================
--- Text-Tags/t/01.parse.t	(original)
+++ Text-Tags/t/01.parse.t	Tue Jun  6 14:04:43 2006
@@ -1,6 +1,6 @@
 use strict;
 use warnings;
-use Test::More tests => 56;
+use Test::More tests => 57;
 
 BEGIN { use_ok 'Text::Tags::Parser' }
 
@@ -68,3 +68,4 @@
 p(q{ " a, b"} => 'a, b');
 p(qq{ "   a   ,    \tb" c}, "a , b", "c");
 
+ok((not defined $parser->parse_tags(undef)), "parsing undef should return undef");


More information about the Rt-commit mailing list