Skip to content
Browse files

add todo test

  • Loading branch information...
1 parent f2abc08 commit cab3400aa383540d89b556ae1dccff3ac8cdb50f @gray committed Nov 30, 2010
Showing with 30 additions and 0 deletions.
  1. +30 −0 t/add_bits.t
View
30 t/add_bits.t
@@ -0,0 +1,30 @@
+use strict;
+use warnings;
+use Test::More tests => 2;
+use Digest::Hamsi;
+
+my $msg = 'ABC';
+my $bits = unpack 'B*', $msg;
+
+my $d = Digest::Hamsi->new(224);
+
+is(
+ $d->reset->add($msg)->hexdigest,
+ $d->reset->add_bits($bits)->hexdigest,
+ 'full message'
+);
+
+TODO: {
+ local $TODO = 'consecutive calls to add_bits with non-bytes';
+
+ is(
+ $d->reset->add_bits(substr $bits, 0, 11)->hexdigest,
+ eval {
+ $d->reset->add_bits(substr $bits, 0, 3)
+ ->add_bits(substr $bits, 3, 5)
+ ->add_bits(substr $bits, 8, 3)
+ ->hexdigest
+ },
+ 'consecutive calls to add_bits with non-bytes'
+ );
+}

0 comments on commit cab3400

Please sign in to comment.
Something went wrong with that request. Please try again.