File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,18 @@ my $not_not_a_number_is_a_number = (
17
17
($json -> backend-> isa(' JSON::PP' ) && ($JSON::PP::Boolean::VERSION || $JSON::backportPP::Boolean::VERSION ))
18
18
) ? 1 : 0;
19
19
20
- is($json -> encode([!1]), ' [""]' );
20
+ my $core_bool_support = JSON-> backend-> can(" CORE_BOOL" ) && JSON-> backend-> CORE_BOOL ? 1 : 0;
21
+
22
+ is($json -> encode([!1]), $core_bool_support ? ' [false]' : ' [""]' );
21
23
if ($not_not_a_number_is_a_number ) {
22
- is($json -> encode([!!2]), ' [1]' );
24
+ is($json -> encode([!!2]), $core_bool_support ? ' [true] ' : ' [1]' );
23
25
} else {
24
26
is($json -> encode([!!2]), ' ["1"]' );
25
27
}
26
28
27
- is($json -> encode([ ' a' eq ' b' ]), ' [""]' );
29
+ is($json -> encode([ ' a' eq ' b' ]), $core_bool_support ? ' [false] ' : ' [""]' );
28
30
if ($not_not_a_number_is_a_number ) {
29
- is($json -> encode([ ' a' eq ' a' ]), ' [1]' );
31
+ is($json -> encode([ ' a' eq ' a' ]), $core_bool_support ? ' [true] ' : ' [1]' );
30
32
} else {
31
33
is($json -> encode([ ' a' eq ' a' ]), ' ["1"]' );
32
34
}
You can’t perform that action at this time.
0 commit comments