Debian Codegraph @

t/105_esc_slash.t

raw
1
2 use Test::More;
3 use strict;
4 use warnings;
5 BEGIN { plan tests => 2 };
6 BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; }
7 use JSON -support_by_pp;
8 #########################
9
10 my $json = JSON->new->allow_nonref;
11
12 my $js = '/';
13
14 is($json->encode($js), '"/"');
15 is($json->escape_slash->encode($js), '"\/"');
16