Closed karenetheridge closed 2 years ago
any interesting tests I come up with should be added to the test suite - see https://github.com/json-schema-org/JSON-Schema-Test-Suite/issues/378
This should fix the issues I'm seeing on this smoker here -- http://www.cpantesters.org/cpan/report/c65fadbe-a2d4-11ea-9066-e374b0ba08e8
on my box:
perl -MCpanel::JSON::XS=decode_json -MDevel::Peek -wle'my $data = decode_json(q{[ 9007199254740992, 9007199254740992.0 ]}); Dump($_) foreach @$data; print $_ foreach @$data'
SV = IV(0x7fd6180025e8) at 0x7fd6180025f8
REFCNT = 2
FLAGS = (IOK,pIOK)
IV = 9007199254740992
SV = NV(0x7fd618002760) at 0x7fd618002778
REFCNT = 2
FLAGS = (NOK,pNOK)
NV = 9.00719925474099e+15
9007199254740992
9.00719925474099e+15
let's see what it looks like on BinGOs's machine..
Different VM from the one that generated that report, but another 32bit Debian. Got a similar fail, so here is the output:
$ /opt/perl-5.22.4/bin/perl -MCpanel::JSON::XS=decode_json -MDevel::Peek -wle'my $data = decode_json(q{[ 9007199254740992, 9007199254740992.0 ]}); Dump($_) foreach @$data; print $_ foreach @$data'
SV = PV(0x1fb70e0) at 0x1fb6500
REFCNT = 2
FLAGS = (POK,pPOK)
PV = 0x1fcbaf0 "9007199254740992"\0
CUR = 16
LEN = 18
SV = NV(0x1fd51fc) at 0x1fb6f90
REFCNT = 2
FLAGS = (NOK,pNOK)
NV = 9.00719925474099e+15
9007199254740992
9.00719925474099e+15
until I add bigint/bignum handling, I should just mark this specific test TODO if $Config{something}
.
This is now complete, and with version 0.537, hopefully bug free.
Cpanel::JSON::XS has a 'get_allow_bignum' option which inflates very large numbers into Math::BigInt or Math::BigFloat objects. If desired, we should support validating integers and numbers using this.