This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[Merge] Constants, inlined subs, TARGs, ...
[perl5.git] / cpan / JSON-PP / t / 116_incr_parse_fixed.t
CommitLineData
7942a65c
CBW
1#!/usr/bin/perl
2
3use strict;
4use Test::More tests => 4;
5
6use JSON::PP;
7
8my $json = JSON::PP->new->allow_nonref();
9
10my @vs = $json->incr_parse('"a\"bc');
11
12ok( not scalar(@vs) );
13
14@vs = $json->incr_parse('"');
15
16is( $vs[0], "a\"bc" );
17
18
19$json = JSON::PP->new;
20
21@vs = $json->incr_parse('"a\"bc');
22ok( not scalar(@vs) );
23@vs = eval { $json->incr_parse('"') };
24ok($@ =~ qr/JSON text must be an object or array/);
25