make this release a trial release
[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
9my $data = JSON->new->decode('{"foo": true, "bar": false, "baz": 1}');
10
11ok(
12 JSON::is_bool($data->{foo}),
13 'JSON.pm: true decodes to a bool',
14);
15ok(
16 JSON::is_bool($data->{bar}),
17 'JSON.pm:: false decodes to a bool',
18);
19ok(
20 !JSON::is_bool($data->{baz}),
21 'JSON.pm: int does not decode to a bool',
22);
23
24done_testing;