Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added tests for pack and unpack. Fixed a bug in pack

  • Loading branch information...
commit 5b51c3057aa5cf3521616b60d0076881304f6ff6 1 parent 02ccad0
@brunoV brunoV authored
Showing with 16 additions and 1 deletion.
  1. +1 −1  Core.pm
  2. +8 −0 t/pack.t
  3. +7 −0 t/unpack.t
View
2  Core.pm
@@ -651,7 +651,7 @@ sub lc ($) { CORE::lc($_[0]); }
sub lcfirst ($) { CORE::lcfirst($_[0]); }
sub length ($) { CORE::length($_[0]); }
sub ord ($) { CORE::ord($_[0]); }
-sub pack ($;@) { CORE::pack(@_); }
+sub pack ($;@) { CORE::pack(shift, @_); }
sub reverse ($) { CORE::reverse($_[0]); }
sub rindex ($@) {
View
8 t/pack.t
@@ -0,0 +1,8 @@
+use Test::More qw(no_plan);
+use strict;
+use warnings;
+
+use autobox::Core;
+
+is 'nN'->pack(42, 4711), pack('nN', 42, 4711);
+is '(sl)<'->pack(-42, 4711), pack('(sl)<', -42, 4711);
View
7 t/unpack.t
@@ -0,0 +1,7 @@
+use Test::More qw(no_plan);
+use strict;
+use warnings;
+
+use autobox::Core;
+
+is 'W'->unpack("foo"), unpack('W', "foo");
Please sign in to comment.
Something went wrong with that request. Please try again.