Blame t/xe04_escape_slash.t
|
Packit Service |
639957 |
use strict;
|
|
Packit Service |
639957 |
use Test::More;
|
|
Packit Service |
639957 |
BEGIN { plan tests => 3 };
|
|
Packit Service |
639957 |
|
|
Packit Service |
639957 |
BEGIN { $ENV{PERL_JSON_BACKEND} ||= 1; }
|
|
Packit Service |
639957 |
|
|
Packit Service |
639957 |
use JSON -support_by_pp;
|
|
Packit Service |
639957 |
|
|
Packit Service |
639957 |
SKIP: {
|
|
Packit Service |
639957 |
skip "can't use JSON::XS.", 3, unless( JSON->backend->is_xs );
|
|
Packit Service |
639957 |
|
|
Packit Service |
639957 |
my $json = new JSON;
|
|
Packit Service |
639957 |
|
|
Packit Service |
639957 |
|
|
Packit Service |
639957 |
is($json->escape_slash(0)->allow_nonref->encode("/"), '"/"');
|
|
Packit Service |
639957 |
is($json->escape_slash(1)->allow_nonref->encode("/"), '"\/"');
|
|
Packit Service |
639957 |
is($json->escape_slash(0)->allow_nonref->encode("/"), '"/"');
|
|
Packit Service |
639957 |
|
|
Packit Service |
639957 |
|
|
Packit Service |
639957 |
}
|
|
Packit Service |
639957 |
__END__
|
|
Packit Service |
639957 |
|