summaryrefslogtreecommitdiff
path: root/t/xe21_is_pp.t
blob: 4106b9461d7323a3d1a0a45b1f46635c24d1abe6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use strict;
use Test::More;

BEGIN { plan tests => 5 };

BEGIN {
    $ENV{PERL_JSON_BACKEND} ||= 1;
}

use JSON;

my $json = JSON->new();

ok( $json->backend, 'backend is ' . $json->backend );

if ( $json->backend->is_xs ) {
    ok (!JSON->is_pp(), 'JSON->is_pp()');
    ok ( JSON->is_xs(), 'JSON->is_xs()');
    ok (!$json->is_pp(), '$json->is_pp()');
    ok ( $json->is_xs(), '$json->is_xs()');
}
else {
    ok ( JSON->is_pp(), 'JSON->is_pp()');
    ok (!JSON->is_xs(), 'JSON->is_xs()');
    ok ( $json->is_pp(), '$json->is_pp()');
    ok (!$json->is_xs(), '$json->is_xs()');
}