r3682 - in /packages/libemail-simple-perl/trunk: Changes MANIFEST META.yml debian/changelog lib/Email/Simple.pm t/basic.t t/undef-message.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Sat Sep 9 18:57:42 UTC 2006


Author: gregoa-guest
Date: Sat Sep  9 18:57:41 2006
New Revision: 3682

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=3682
Log:
* New upstream release.

Added:
    packages/libemail-simple-perl/trunk/t/undef-message.t
      - copied unchanged from r3681, packages/libemail-simple-perl/branches/upstream/current/t/undef-message.t
Modified:
    packages/libemail-simple-perl/trunk/Changes
    packages/libemail-simple-perl/trunk/MANIFEST
    packages/libemail-simple-perl/trunk/META.yml
    packages/libemail-simple-perl/trunk/debian/changelog
    packages/libemail-simple-perl/trunk/lib/Email/Simple.pm
    packages/libemail-simple-perl/trunk/t/basic.t

Modified: packages/libemail-simple-perl/trunk/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-simple-perl/trunk/Changes?rev=3682&op=diff
==============================================================================
--- packages/libemail-simple-perl/trunk/Changes (original)
+++ packages/libemail-simple-perl/trunk/Changes Sat Sep  9 18:57:41 2006
@@ -1,4 +1,9 @@
 Revision history for Perl extension Email::Simple.
+
+1.990    2006-09-05
+
+  - ->header('foo') returns false if there is no foo header (formerly '')
+  - croak if an undef value is passed to new()
 
 1.980    2006-08-17
 

Modified: packages/libemail-simple-perl/trunk/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-simple-perl/trunk/MANIFEST?rev=3682&op=diff
==============================================================================
--- packages/libemail-simple-perl/trunk/MANIFEST (original)
+++ packages/libemail-simple-perl/trunk/MANIFEST Sat Sep  9 18:57:41 2006
@@ -26,5 +26,6 @@
 t/test-mails/junk-in-header
 t/test-mails/long-msgid
 t/test-mails/many-repeats
+t/undef-message.t
 t/unit.t
 META.yml                                 Module meta-data (added by MakeMaker)

Modified: packages/libemail-simple-perl/trunk/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-simple-perl/trunk/META.yml?rev=3682&op=diff
==============================================================================
--- packages/libemail-simple-perl/trunk/META.yml (original)
+++ packages/libemail-simple-perl/trunk/META.yml Sat Sep  9 18:57:41 2006
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Email-Simple
-version:      1.980
+version:      1.990
 version_from: lib/Email/Simple.pm
 installdirs:  site
 requires:

Modified: packages/libemail-simple-perl/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-simple-perl/trunk/debian/changelog?rev=3682&op=diff
==============================================================================
--- packages/libemail-simple-perl/trunk/debian/changelog (original)
+++ packages/libemail-simple-perl/trunk/debian/changelog Sat Sep  9 18:57:41 2006
@@ -1,3 +1,9 @@
+libemail-simple-perl (1.990-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregor+debian at comodo.priv.at>  Sat,  9 Sep 2006 20:56:47 +0200
+
 libemail-simple-perl (1.980-1) unstable; urgency=low
 
   * New upstream release

Modified: packages/libemail-simple-perl/trunk/lib/Email/Simple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-simple-perl/trunk/lib/Email/Simple.pm?rev=3682&op=diff
==============================================================================
--- packages/libemail-simple-perl/trunk/lib/Email/Simple.pm (original)
+++ packages/libemail-simple-perl/trunk/lib/Email/Simple.pm Sat Sep  9 18:57:41 2006
@@ -5,7 +5,7 @@
 use Carp;
 
 use vars qw($VERSION $GROUCHY);
-$VERSION = '1.980';
+$VERSION = '1.990';
 
 my $crlf = qr/\x0a\x0d|\x0d\x0a|\x0a|\x0d/; # We are liberal in what we accept.
 
@@ -52,6 +52,9 @@
 
 sub new {
     my ($class, $text) = @_;
+
+    croak 'Unable to parse undefined message' if !defined $text;
+
     my ($head, $body, $mycrlf) = _split_head_from_body($text);
     my ($head_hash, $order) = _read_headers($head);
     bless {
@@ -121,7 +124,10 @@
 
 sub header {
     my ($self, $field) = @_;
-    return '' unless $field = $self->{header_names}->{lc $field};
+    return unless
+      (exists $self->{header_names}->{lc $field})
+      and $field = $self->{header_names}->{lc $field};
+
     return wantarray ? @{$self->{head}->{$field}}
                      :   $self->{head}->{$field}->[0];
 }

Modified: packages/libemail-simple-perl/trunk/t/basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-simple-perl/trunk/t/basic.t?rev=3682&op=diff
==============================================================================
--- packages/libemail-simple-perl/trunk/t/basic.t (original)
+++ packages/libemail-simple-perl/trunk/t/basic.t Sat Sep  9 18:57:41 2006
@@ -19,7 +19,11 @@
 is($mail->header_set("From", $sc), $sc, "Setting returns new value");
 is($mail->header("From"), $sc, "Which is consistently returned");
 
-is($mail->header("Bogus"), '', "missing header returns '' (this may change!)");
+is(
+  $mail->header("Bogus"),
+  undef,
+  "missing header returns undef"
+);
 
 # Put andrew back:
 $mail->header_set("From", $old_from);




More information about the Pkg-perl-cvs-commits mailing list