summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/JSON-PP/t/010_pc_keysort.t
blob: cec6fe1936cd00182cbfbf63a3864aca7ab3245e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# copied over from JSON::PC and modified to use JSON::PP
# copied over from JSON::XS and modified to use JSON::PP

use Test::More;
use strict;
BEGIN { plan tests => 1 };
BEGIN { $ENV{PERL_JSON_BACKEND} = 0; }

use JSON::PP;
#########################

my ($js,$obj);
my $pc = JSON::PP->new->canonical(1);

$obj = {a=>1, b=>2, c=>3, d=>4, e=>5, f=>6, g=>7, h=>8, i=>9};

$js = $pc->encode($obj);
is($js, q|{"a":1,"b":2,"c":3,"d":4,"e":5,"f":6,"g":7,"h":8,"i":9}|);