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/xe01_property.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
2 use Test::More;
3 use strict;
4
5 BEGIN { plan tests => 90 };
6
7 BEGIN { $ENV{PERL_JSON_BACKEND} = 1; }
8
9
10 use JSON;
11
12 SKIP: {
13 skip "can't use JSON::XS.", 90, unless( JSON->backend->is_xs );
14
15 my @simples =
16 qw/ascii latin1 utf8 indent canonical space_before space_after allow_nonref shrink allow_blessed
17 convert_blessed relaxed
18 /;
19
20 my $json = new JSON;
21
22 for my $name (@simples) {
23 my $method = 'get_' . $name;
24 ok(! $json->$method(), $method . ' default');
25 $json->$name();
26 ok($json->$method(), $method . ' set true');
27 $json->$name(0);
28 ok(! $json->$method(), $method . ' set false');
29 $json->$name();
30 ok($json->$method(), $method . ' set true again');
31 }
32
33
34 ok($json->get_max_depth == 512, 'get_max_depth default');
35 $json->max_depth(7);
36 ok($json->get_max_depth == 7, 'get_max_depth set 7 => 7');
37 $json->max_depth();
38 ok($json->get_max_depth != 0, 'get_max_depth no arg');
39
40 ok($json->get_max_size == 0, 'get_max_size default');
41 $json->max_size(7);
42 ok($json->get_max_size == 7, 'get_max_size set 7 => 7');
43 $json->max_size();
44 ok($json->get_max_size == 0, 'get_max_size no arg');
45
46
47 for my $name (@simples) {
48 $json->$name();
49 ok($json->property($name), $name);
50 $json->$name(0);
51 ok(! $json->property($name), $name);
52 $json->$name();
53 ok($json->property($name), $name);
54 }
55
56 }
OLDNEW
« no previous file with comments | « trunk/src/third_party/JSON/JSON-2.59/t/x17_strange_overload.t ('k') | trunk/src/third_party/JSON/JSON-2.59/t/xe02_bool.t » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698