Debian Codegraph @

t/21_evans.t

raw
1 # copied over from JSON::XS and modified to use JSON
2
3 # adapted from a test by Martin Evans
4
5 use strict;
6 use warnings;
7
8 BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; }
9
10 use JSON;
11
12 print "1..1\n";
13
14 my $data = ["\x{53f0}\x{6240}\x{306e}\x{6d41}\x{3057}",
15 "\x{6c60}\x{306e}\x{30ab}\x{30a8}\x{30eb}"];
16 my $js = JSON->new->encode ($data);
17 my $j = JSON->new;
18 my $object = $j->incr_parse ($js);
19
20 die "no object" if !$object;
21
22 eval { $j->incr_text };
23
24 print $@ ? "not " : "", "ok 1 # $@\n";
25