4 BEGIN { plan tests => 6 };
6 BEGIN { $ENV{PERL_JSON_BACKEND} = "JSON::backportPP"; }
10 use _unicode_handling;
16 print JSON->backend, "\t", JSON->backend->VERSION, "\n";
18 my $data = ["\x{3042}\x{3044}\x{3046}\x{3048}\x{304a}",
19 "\x{304b}\x{304d}\x{304f}\x{3051}\x{3053}"];
22 my $js = $j->encode($data);
25 my @parts = (substr($js, 0, int(length($js) / 2)),
26 substr($js, int(length($js) / 2)));
28 my $object = $j->incr_parse($parts[0]);
30 ok( !defined $object );
36 like( $@, qr/incr_text can not be called when the incremental parser already started parsing/ );
38 $object = $j->incr_parse($parts[1]);
40 ok( defined $object );
42 is( $object->[0], $data->[0] );
43 is( $object->[1], $data->[1] );