apply with_JSON_XS_v2.patch from RT#94892
[p5sagit/JSON-MaybeXS.git] / t / preload_cpanel.t
diff --git a/t/preload_cpanel.t b/t/preload_cpanel.t
new file mode 100644 (file)
index 0000000..2c9243a
--- /dev/null
@@ -0,0 +1,19 @@
+use strict;
+use warnings FATAL => 'all';
+use if !do { require Cpanel::JSON::XS; 1; }, 'Test::More', skip_all => 'No Cpanel::JSON::XS';
+use Test::More;
+use JSON::MaybeXS;
+
+is(JSON, 'Cpanel::JSON::XS', 'Correct JSON class');
+
+is(
+  \&encode_json, \&Cpanel::JSON::XS::encode_json,
+  'Correct encode_json function'
+);
+
+is(
+  \&decode_json, \&Cpanel::JSON::XS::decode_json,
+  'Correct encode_json function'
+);
+
+done_testing;