File: 116_incr_parse_fixed.t

package info (click to toggle)
libjson-pp-perl 2.27400-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 328 kB
  • ctags: 101
  • sloc: perl: 1,681; sh: 15; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 408 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl

use strict;
use Test::More tests => 4;

use JSON::PP;

my $json = JSON::PP->new->allow_nonref();

my @vs = $json->incr_parse('"a\"bc');

ok( not scalar(@vs) );

@vs = $json->incr_parse('"');

is( $vs[0], "a\"bc" );


$json = JSON::PP->new;

@vs = $json->incr_parse('"a\"bc');
ok( not scalar(@vs) );
@vs = eval { $json->incr_parse('"') };
ok($@ =~ qr/JSON text must be an object or array/);