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