File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 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 = (
1717 ($json -> backend-> isa(' JSON::PP' ) && ($JSON::PP::Boolean::VERSION || $JSON::backportPP::Boolean::VERSION ))
1818) ? 1 : 0;
1919
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]' : ' [""]' );
2123if ($not_not_a_number_is_a_number ) {
22- is($json -> encode([!!2]), ' [1]' );
24+ is($json -> encode([!!2]), $core_bool_support ? ' [true] ' : ' [1]' );
2325} else {
2426is($json -> encode([!!2]), ' ["1"]' );
2527}
2628
27- is($json -> encode([ ' a' eq ' b' ]), ' [""]' );
29+ is($json -> encode([ ' a' eq ' b' ]), $core_bool_support ? ' [false] ' : ' [""]' );
2830if ($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]' );
3032} else {
3133is($json -> encode([ ' a' eq ' a' ]), ' ["1"]' );
3234}
You can’t perform that action at this time.
0 commit comments