Permalink
Browse files

Test Sum::Marshal::Block on MD2 16-byte blocks

  • Loading branch information...
1 parent 1189271 commit d8543f8f3dd8f326fb3f5bc618d6a66ab336d029 @skids committed Dec 5, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 t/md.t
View
10 t/md.t
@@ -3,8 +3,9 @@ BEGIN { @*INC.unshift: './lib'; }
use Test;
-plan 59;
+plan 61;
+use Sum;
use Sum::MD;
ok 1,'We use Sum::MD and we are still alive';
@@ -221,6 +222,13 @@ is MD2t.new().finalize(Buf.new(97 xx 16), Buf.new(97)),
0xdbf15a5fdfd6f7e9ece27d5e310c58ed,
"MD2 of a 17-byte buffer is correct.";
+class MD2d does Sum::MD2 does Sum::Marshal::Block[:elems(16)] { };
+my MD2d $s3 .= new();
+ok $s3.WHAT === MD2d, 'We create a dwimmy Block MD2 class and object';
+
+is $s3.finalize(Buf.new(97 xx 17)), 0xdbf15a5fdfd6f7e9ece27d5e310c58ed,
+ "MD2 of a 17-byte buffer using Sum::Marshal::Block.";
+
# Now grab the code in the synopsis from the POD and make sure it runs.
# This is currently complete hackery but might improve when pod support does.
# And also an outputs_ok Test.pm function that redirects $*OUT might be nice.

0 comments on commit d8543f8

Please sign in to comment.