Chromium Code Reviews

Unified Diff: third_party/JSON/JSON-2.58/t/e90_misc.t

Issue 15736030: Add JSON.pm to third_party (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check SHA-1 hash Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: third_party/JSON/JSON-2.58/t/e90_misc.t
diff --git a/third_party/JSON/JSON-2.58/t/e90_misc.t b/third_party/JSON/JSON-2.58/t/e90_misc.t
new file mode 100644
index 0000000000000000000000000000000000000000..39d7e8d353e65bea806b540533e8f5f479a391c9
--- /dev/null
+++ b/third_party/JSON/JSON-2.58/t/e90_misc.t
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+
+use strict;
+use Test::More tests => 4;
+
+BEGIN {
+ $ENV{ PERL_JSON_BACKEND } = $ARGV[0] || '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 } ) );

Powered by Google App Engine