Skip to content

Commit 23f714a

Browse files
committed
Add a test
1 parent 46afe3e commit 23f714a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

t/gh_89_space_after_comma.t

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use strict;
2+
use warnings;
3+
use Test::More;
4+
5+
BEGIN { $ENV{PERL_JSON_BACKEND} = 0; }
6+
7+
my @candidates = qw(JSON::PP JSON::XS Cpanel::JSON::XS);
8+
9+
for my $json_module (@candidates) {
10+
eval "require $json_module; 1" or next;
11+
my $got = $json_module->new->utf8->space_after(1)->encode({x=>[1,2]});
12+
is $got => qq!{"x": [1, 2]}!, "$json_module has a space after 1";
13+
}
14+
15+
done_testing;

0 commit comments

Comments
 (0)