actually load JSON::MaybeXS in JSON.pm bool test
[p5sagit/JSON-MaybeXS.git] / xt / json_pm.t
CommitLineData
1ca3b561 1use strict;
4e1fb2f8 2use warnings;
1ca3b561 3use Test::More;
4
5unless ( eval { require JSON; 1 } ) {
6 plan skip_all => 'No JSON';
7}
8
a90ee583 9use JSON::MaybeXS;
10
20f884e2 11my $data = JSON()->new->decode('{"foo": true, "bar": false, "baz": 1}');
1ca3b561 12
13ok(
14 JSON::is_bool($data->{foo}),
15 'JSON.pm: true decodes to a bool',
16);
17ok(
18 JSON::is_bool($data->{bar}),
19 'JSON.pm:: false decodes to a bool',
20);
21ok(
22 !JSON::is_bool($data->{baz}),
23 'JSON.pm: int does not decode to a bool',
24);
25
26done_testing;