summaryrefslogtreecommitdiff
path: root/perl
diff options
context:
space:
mode:
authorTokuhiro Matsuno <tokuhirom@gmail.com>2009-07-03 17:27:44 +0900
committerTokuhiro Matsuno <tokuhirom@gmail.com>2009-07-03 17:27:44 +0900
commitad7cf12128388b8432ffe33c2010d0d0580297c3 (patch)
tree63975a6fab2d588f0a7f162815202fda32771314 /perl
parent6fb6283463db961677a00b1ea00552e5e9679d1c (diff)
downloadmsgpack-python-ad7cf12128388b8432ffe33c2010d0d0580297c3.tar.gz
perl: added test case for "the flag is working?"
Diffstat (limited to 'perl')
-rw-r--r--perl/t/05_preferred_int.t16
1 files changed, 13 insertions, 3 deletions
diff --git a/perl/t/05_preferred_int.t b/perl/t/05_preferred_int.t
index 39c725a..9860711 100644
--- a/perl/t/05_preferred_int.t
+++ b/perl/t/05_preferred_int.t
@@ -38,10 +38,20 @@ my @dat = (
{'0' => '1'}, '81 00 01',
{'abc' => '1'}, '81 a3 61 62 63 01',
);
-plan tests => 1*(scalar(@dat)/2);
+plan tests => 1*(scalar(@dat)/2) + 2;
-$Data::MessagePack::PreferInteger = 1;
for (my $i=0; $i<scalar(@dat); ) {
- pis $dat[$i++], $dat[$i++];
+ local $Data::MessagePack::PreferInteger = 1;
+ my($x, $y) = ($i++, $i++);
+ pis $dat[$x], $dat[$y];
+}
+
+# flags working?
+{
+ local $Data::MessagePack::PreferInteger;
+ $Data::MessagePack::PreferInteger = 1;
+ pis '0', '00';
+ $Data::MessagePack::PreferInteger = 0;
+ pis '0', 'a1 30';
}