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