The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use warnings;

use Test::More;
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',
);
ok(
    JSON::MaybeXS::is_bool($data->{bar}),
    JSON() . ': false decodes to a bool',
);
ok(
    !JSON::MaybeXS::is_bool($data->{baz}),
    JSON() . ': int does not decode to a bool',
);

1;