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

Side by Side Diff: trunk/src/third_party/JSON/JSON-2.59/t/e12_upgrade.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 => 3 };
5
6 BEGIN { $ENV{PERL_JSON_BACKEND} = "JSON::backportPP"; }
7
8 use JSON;
9
10 BEGIN {
11 use lib qw(t);
12 use _unicode_handling;
13 }
14
15 my $json = JSON->new->allow_nonref->utf8;
16 my $str = '\\u00c8';
17
18 my $value = $json->decode( '"\\u00c8"' );
19
20 #use Devel::Peek;
21 #Dump( $value );
22
23 is( $value, chr 0xc8 );
24
25 SKIP: {
26 skip "UNICODE handling is disabale.", 1 unless $JSON::can_handle_UTF16_and_u tf8;
27 ok( utf8::is_utf8( $value ) );
28 }
29
30 eval { $json->decode( '"' . chr(0xc8) . '"' ) };
31 ok( $@ =~ /malformed UTF-8 character in JSON string/ );
32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698