summaryrefslogtreecommitdiff
path: root/t/e90_misc.t
diff options
context:
space:
mode:
Diffstat (limited to 't/e90_misc.t')
-rw-r--r--t/e90_misc.t17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/e90_misc.t b/t/e90_misc.t
new file mode 100644
index 0000000..69b635a
--- /dev/null
+++ b/t/e90_misc.t
@@ -0,0 +1,17 @@
+use strict;
+use Test::More tests => 4;
+
+BEGIN {
+ $ENV{ PERL_JSON_BACKEND } ||= 'JSON::backportPP';
+}
+
+use JSON;
+
+# reported by https://rt.cpan.org/Public/Bug/Display.html?id=68359
+
+eval { JSON->to_json( 5, { allow_nonref => 1 } ) };
+ok($@);
+
+is( q{"5"}, JSON::to_json( "5", { allow_nonref => 1 } ) );
+is( q{5}, JSON::to_json( 5, { allow_nonref => 1 } ) );
+is( q{"JSON"}, JSON::to_json( 'JSON', { allow_nonref => 1 } ) );