Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: trunk/src/third_party/JSON/JSON-2.59/t/21_evans_bugrep.t

Issue 16539003: Revert 205057 "Add JSON.pm to third_party" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 use strict;
2 use Test::More;
3
4 BEGIN { plan tests => 6 };
5
6 BEGIN { $ENV{PERL_JSON_BACKEND} = "JSON::backportPP"; }
7
8 BEGIN {
9 use lib qw(t);
10 use _unicode_handling;
11 }
12
13
14 use JSON;
15
16 print JSON->backend, "\t", JSON->backend->VERSION, "\n";
17
18 my $data = ["\x{3042}\x{3044}\x{3046}\x{3048}\x{304a}",
19 "\x{304b}\x{304d}\x{304f}\x{3051}\x{3053}"];
20
21 my $j = new JSON;
22 my $js = $j->encode($data);
23 $j = undef;
24
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]);
29
30 ok( !defined $object );
31
32 eval {
33 $j->incr_text;
34 };
35
36 like( $@, qr/incr_text can not be called when the incremental parser already sta rted parsing/ );
37
38 $object = $j->incr_parse($parts[1]);
39
40 ok( defined $object );
41
42 is( $object->[0], $data->[0] );
43 is( $object->[1], $data->[1] );
44
45 eval {
46 $j->incr_text;
47 };
48
49 ok( !$@ );
50
OLDNEW
« no previous file with comments | « trunk/src/third_party/JSON/JSON-2.59/t/20_unknown.t ('k') | trunk/src/third_party/JSON/JSON-2.59/t/22_comment_at_eof.t » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698