Properly route WebView input events to the compositor
[chromium-blink-merge.git] / third_party / JSON / JSON-2.59 / t / 21_evans_bugrep.t
blob2e6200da67e9f83eb35bc15b383ace1548ce86de
1 use strict;
2 use Test::More;
4 BEGIN { plan tests => 6 };
6 BEGIN { $ENV{PERL_JSON_BACKEND} = "JSON::backportPP"; }
8 BEGIN {
9     use lib qw(t);
10     use _unicode_handling;
14 use JSON;
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}"];
21 my $j = new JSON;
22 my $js = $j->encode($data);
23 $j = undef;
25 my @parts = (substr($js, 0, int(length($js) / 2)),
26              substr($js, int(length($js) / 2)));
27 $j = JSON->new;
28 my $object = $j->incr_parse($parts[0]);
30 ok( !defined $object );
32 eval {
33     $j->incr_text;
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] );
45 eval {
46     $j->incr_text;
49 ok( !$@ );