diff options
Diffstat (limited to 't/e05_esc_slash.t')
-rw-r--r-- | t/e05_esc_slash.t | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/e05_esc_slash.t b/t/e05_esc_slash.t new file mode 100644 index 0000000..9be12cf --- /dev/null +++ b/t/e05_esc_slash.t @@ -0,0 +1,15 @@ +
+use Test::More;
+use strict;
+BEGIN { plan tests => 2 };
+BEGIN { $ENV{PERL_JSON_BACKEND} = "JSON::backportPP"; }
+use JSON;
+#########################
+
+my $json = JSON->new->allow_nonref;
+
+my $js = '/';
+
+is($json->encode($js), '"/"');
+is($json->escape_slash->encode($js), '"\/"');
+
|