xref: /openbsd-src/gnu/usr.bin/perl/cpan/JSON-PP/t/rt_116998_wrong_character_offset.t (revision 256a93a44f36679bee503f12e49566c2183f6181)
1use strict;
2use warnings;
3use Test::More;
4BEGIN { plan tests => 4 };
5BEGIN { $ENV{PERL_JSON_BACKEND} = 0; }
6use JSON::PP;
7
8{ #SKIP_UNLESS_PP 2.90, 1
9eval { decode_json(qq({"foo":{"bar":42})) };
10like $@ => qr/offset 17/; # 16
11}
12
13eval { decode_json(qq(["foo",{"bar":42})) };
14like $@ => qr/offset 17/;
15
16{ #SKIP_UNLESS_PP 2.90, 1
17eval { decode_json(qq(["foo",{"bar":42}"])) };
18like $@ => qr/offset 17/; # 18
19}
20
21eval { decode_json(qq({"foo":{"bar":42}"})) };
22like $@ => qr/offset 17/;
23
24