[Bps-public-commit] r14290 - in Data-Plist: .

kyoki at bestpractical.com kyoki at bestpractical.com
Fri Jul 18 17:01:44 EDT 2008


Author: kyoki
Date: Fri Jul 18 17:01:00 2008
New Revision: 14290

Modified:
   Data-Plist/   (props changed)
   Data-Plist/t/binary-load.t
   Data-Plist/t/binary-write.t

Log:
 r29798 at nyx:  kyoki | 2008-07-18 17:00:41 -0400
 more tests! testing data for BinaryWriter and reading bplists that contain bplists for BinaryReader


Modified: Data-Plist/t/binary-load.t
==============================================================================
--- Data-Plist/t/binary-load.t	(original)
+++ Data-Plist/t/binary-load.t	Fri Jul 18 17:01:00 2008
@@ -1,9 +1,11 @@
-use Test::More tests => 44;
+use Test::More no_plan => 1;
 
 use strict;
 use warnings;
 
 use Data::Plist::BinaryReader;
+use Data::Plist::BinaryWriter;
+
 my $ret;
 
 # Create the object
@@ -11,6 +13,11 @@
 ok( $read, "Created a binary reader" );
 isa_ok( $read, "Data::Plist::BinaryReader" );
 
+# Create writer
+my $write = Data::Plist::BinaryWriter->new;
+ok( $write, "Created a binary writer" );
+isa_ok( $write, "Data::Plist::BinaryWriter" );
+
 ### Basic plist munging
 
 # Magic header is magic
@@ -134,3 +141,10 @@
     ],
     "Raw structure matches",
 );
+
+# Data contains bplist
+my $bplist = $write->write({});
+my $in = $write->write({"test" => $bplist});
+ok ($in, "Binary data written.");
+$ret = $read->open_string($in);
+ok ($ret, "Opening from string worked");

Modified: Data-Plist/t/binary-write.t
==============================================================================
--- Data-Plist/t/binary-write.t	(original)
+++ Data-Plist/t/binary-write.t	Fri Jul 18 17:01:00 2008
@@ -1,4 +1,4 @@
-use Test::More tests => 180;
+use Test::More no_plan => 1;
 
 use strict;
 use warnings;
@@ -64,6 +64,9 @@
 preserialized_trip( [ fill  => 15 ], 44 );
 preserialized_trip( [ null  => 0 ],  42 );
 
+# Data
+preserialized_trip ( [ data => "\x00"], 43);
+
 sub round_trip {
     my $write = Data::Plist::BinaryWriter->new;
     $in = trip($write, @_);



More information about the Bps-public-commit mailing list