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