[Bps-public-commit] r14285 - in Data-Plist: . lib/Data/Plist lib/Foundation

kyoki at bestpractical.com kyoki at bestpractical.com
Fri Jul 18 16:11:36 EDT 2008


Author: kyoki
Date: Fri Jul 18 16:11:22 2008
New Revision: 14285

Modified:
   Data-Plist/   (props changed)
   Data-Plist/lib/Data/Plist/Writer.pm
   Data-Plist/lib/Data/Plist/XMLWriter.pm
   Data-Plist/lib/Foundation/NSMutableData.pm
   Data-Plist/t/binary-write.t

Log:
 r29790 at nyx:  kyoki | 2008-07-18 16:10:32 -0400
 whooo tests.


Modified: Data-Plist/lib/Data/Plist/Writer.pm
==============================================================================
--- Data-Plist/lib/Data/Plist/Writer.pm	(original)
+++ Data-Plist/lib/Data/Plist/Writer.pm	Fri Jul 18 16:11:22 2008
@@ -79,9 +79,7 @@
         return [ integer => $value ];
     } elsif ( Scalar::Util::looks_like_number($value) ) {
         return [ real => $value ];
-    } elsif ( $value =~ /\0/ or $value =~ /<\?xml/) {
-        # XXX TODO: The /<\?xml/ is a hack to get it labelled DATA
-        # until we use BinaryWriter to write nested plists
+    } elsif ( $value =~ /\0/) {
         return [ data => $value ];
     } else {
         return [ string => $value ];

Modified: Data-Plist/lib/Data/Plist/XMLWriter.pm
==============================================================================
--- Data-Plist/lib/Data/Plist/XMLWriter.pm	(original)
+++ Data-Plist/lib/Data/Plist/XMLWriter.pm	Fri Jul 18 16:11:22 2008
@@ -33,7 +33,7 @@
     my $self = shift;
     my $data = shift;
 
-    if ( $data->[0] =~ /^(true|false)$/ ) {
+    if ( $data->[0] =~ /^(true|false|fill|null)$/ ) {
         $self->{x}->emptyTag( $data->[0] );
     } elsif ( $data->[0] =~ /^(integer|real|date|string|ustring)$/ ) {
         $self->{x}->dataElement( $data->[0], $data->[1] );

Modified: Data-Plist/lib/Foundation/NSMutableData.pm
==============================================================================
--- Data-Plist/lib/Foundation/NSMutableData.pm	(original)
+++ Data-Plist/lib/Foundation/NSMutableData.pm	Fri Jul 18 16:11:22 2008
@@ -13,8 +13,7 @@
 sub serialize_equiv {
     my $self = shift;
     return $self->SUPER::serialize_equiv unless ref $self->data;
-    # XXX TODO: This should be BinaryWriter, but it hasn't been written yet
-    return { "NS.data" => Data::Plist::XMLWriter->write($self->data) };
+    return { "NS.data" => Data::Plist::BinaryWriter->write($self->data) };
 }
 
 1;

Modified: Data-Plist/t/binary-write.t
==============================================================================
--- Data-Plist/t/binary-write.t	(original)
+++ Data-Plist/t/binary-write.t	Fri Jul 18 16:11:22 2008
@@ -84,7 +84,7 @@
     $out = $write->write($input);
     ok( $out, "Created data structure" );
     like( $out, qr/^bplist00/, "Bplist begins with correct header" );
-    is_deeply( $@, '', "No errors thrown." );
+    is( "$@", '', "No errors thrown." );
     is( length($out), $expected_size,
         "Bplist is " . $expected_size . " bytes long." );
     $in = eval { $read->open_string($out) };



More information about the Bps-public-commit mailing list