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

Side by Side Diff: trunk/src/third_party/JSON/JSON-2.59/t/09_pc_extra_number.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 # copied over from JSON::PC and modified to use JSON
2 # copied over from JSON::XS and modified to use JSON
3
4 use Test::More;
5 use strict;
6 BEGIN { plan tests => 6 };
7
8 BEGIN { $ENV{PERL_JSON_BACKEND} = "JSON::backportPP"; }
9
10 use JSON;
11
12
13 #########################
14 my ($js,$obj);
15 my $pc = new JSON;
16
17 $js = '{"foo":0}';
18 $obj = $pc->decode($js);
19 is($obj->{foo}, 0, "normal 0");
20
21 $js = '{"foo":0.1}';
22 $obj = $pc->decode($js);
23 is($obj->{foo}, 0.1, "normal 0.1");
24
25
26 $js = '{"foo":10}';
27 $obj = $pc->decode($js);
28 is($obj->{foo}, 10, "normal 10");
29
30 $js = '{"foo":-10}';
31 $obj = $pc->decode($js);
32 is($obj->{foo}, -10, "normal -10");
33
34
35 $js = '{"foo":0, "bar":0.1}';
36 $obj = $pc->decode($js);
37 is($obj->{foo},0, "normal 0");
38 is($obj->{bar},0.1,"normal 0.1");
39
OLDNEW
« no previous file with comments | « trunk/src/third_party/JSON/JSON-2.59/t/08_pc_base.t ('k') | trunk/src/third_party/JSON/JSON-2.59/t/10_pc_keysort.t » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698