Permalink
Browse files

Added test for 'x' in pack()

  • Loading branch information...
Timothy Totten
Timothy Totten committed Oct 12, 2012
1 parent 12d03bf commit f244f315cb2bc0b22db015ec901b28ebfdc9d114
Showing with 16 additions and 1 deletion.
  1. +16 −1 S32-str/pack.t
View
@@ -3,7 +3,7 @@ use Test;
# L<S32::Str/Str/"=item pack">
-plan 3;
+plan 6;
{
my $buf = pack('H*', "414243");
@@ -31,4 +31,19 @@ plan 3;
"C S L n N v V work";
}
+{
+ my $buf = pack('x');
+ is_deeply $buf.contents, [0x00], 'x by itself works';
+}
+
+{
+ my $buf = pack('x4');
+ is_deeply $buf.contents, [0x00, 0x00, 0x00, 0x00], 'x with amount works';
+}
+
+{
+ my $buf = pack('x*');
+ is_deeply $buf.contents, [], 'x* works (as in it does nothing.)';
+}
+
# vim: ft=perl6

0 comments on commit f244f31

Please sign in to comment.