perl: added test case for "the flag is working?"

This commit is contained in:
Tokuhiro Matsuno 2009-07-03 17:27:44 +09:00
parent 6fb6283463
commit ad7cf12128

View File

@ -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';
}