is_bool()
[p5sagit/JSON-MaybeXS.git] / t / lib / is_bool.pm
CommitLineData
1ca3b561 1use strict;
2use warnings;
3
4use Test::More;
5use JSON::MaybeXS;
6
7my $data = JSON::MaybeXS->new->decode('{"foo": true, "bar": false, "baz": 1}');
8ok(
9 JSON::MaybeXS::is_bool($data->{foo}),
10 JSON() . ': true decodes to a bool',
11);
12ok(
13 JSON::MaybeXS::is_bool($data->{bar}),
14 JSON() . ': false decodes to a bool',
15);
16ok(
17 !JSON::MaybeXS::is_bool($data->{baz}),
18 JSON() . ': int does not decode to a bool',
19);
20
211;