1use strict; 2use Test::More; 3BEGIN { plan tests => 3 }; 4 5BEGIN { $ENV{PERL_JSON_BACKEND} = 1; } 6 7use JSON -support_by_pp; 8 9SKIP: { 10 skip "can't use JSON::XS.", 3, unless( JSON->backend->is_xs ); 11 12my $json = new JSON; 13 14 15is($json->escape_slash(0)->allow_nonref->encode("/"), '"/"'); 16is($json->escape_slash(1)->allow_nonref->encode("/"), '"\/"'); 17is($json->escape_slash(0)->allow_nonref->encode("/"), '"/"'); 18 19 20} 21__END__ 22 23