Need to figure out for what versions of JSON::XS, Cpanel::JSON::XS we need to skip bool tests
e.g.
http://www.cpantesters.org/cpan/report/
8f76d388-5549-11e4-a43f-fa922836e1c4
http://www.cpantesters.org/cpan/report/
6f307bd0-6bfe-1014-bdc4-edd1fea000fb
Revision history for JSON-MaybeXS
+ - add some additional test diagnostics, to help find bad version combinations
+ of JSON backends
+
1.002005 - 2014-10-12
- fix "can I haz XS?" logic precedence in Makefile.PL
- added the ':all' export tag
plan skip_all => 'No Cpanel::JSON::XS';
}
+diag 'Using Cpanel::JSON::XS ', Cpanel::JSON::XS->VERSION;
+
is( JSON, 'Cpanel::JSON::XS', 'Correct JSON class' );
is( \&encode_json,
use JSON::MaybeXS;
my $data = JSON::MaybeXS->new->decode('{"foo": true, "bar": false, "baz": 1}');
+diag 'true is: ', explain $data->{foo};
+diag 'false is: ', explain $data->{bar};
+
ok(
JSON::MaybeXS::is_bool($data->{foo}),
JSON() . ': true decodes to a bool',
use strict;
use warnings FATAL => 'all';
+
use Test::Without::Module 'Cpanel::JSON::XS', 'JSON::XS';
use if !eval { require JSON::PP; 1; }, 'Test::More', skip_all => 'No JSON::PP';
use Test::More;
use JSON::MaybeXS;
+diag 'Using JSON::PP ', JSON::PP->VERSION;
+
is(JSON, 'JSON::PP', 'Correct JSON class');
is(
use Test::More;
use JSON::MaybeXS;
+diag 'Using Cpanel::JSON::XS ', Cpanel::JSON::XS->VERSION;
+
is(JSON, 'Cpanel::JSON::XS', 'Correct JSON class');
is(
use strict;
use warnings FATAL => 'all';
+
use if !eval { require JSON::XS; 1; }, 'Test::More', skip_all => 'No JSON::XS';
use Test::More;
use JSON::MaybeXS;
+diag 'Using JSON::XS ', JSON::XS->VERSION;
+
is( JSON, 'JSON::XS', 'Correct JSON class' );
is( \&encode_json, \&JSON::XS::encode_json, 'Correct encode_json function' );
plan skip_all => 'No JSON::XS';
}
+diag 'Using JSON::XS ', JSON::XS->VERSION;
+
is( JSON, 'JSON::XS', 'Correct JSON class' );
is( \&encode_json, \&JSON::XS::encode_json, 'Correct encode_json function' );