summaryrefslogtreecommitdiff
path: root/test/src/json-tests.el
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2018-09-21 21:50:56 +0200
committerPhilipp Stephani <phst@google.com>2018-09-21 21:50:56 +0200
commit9f10e1a0eef0dd5572a34a76617d50df0e3dd357 (patch)
treea6e60eb393bc4e00ef74e83bcf1601a8e40461e8 /test/src/json-tests.el
parent7f3877e83405a089b580fe9d0342dc0b6c08cbfc (diff)
downloademacs-9f10e1a0eef0dd5572a34a76617d50df0e3dd357.tar.gz
Support bignums when serializing JSON
* src/json.c (lisp_to_json): Support bignums. * test/src/json-tests.el (json-serialize/bignum): New test.
Diffstat (limited to 'test/src/json-tests.el')
-rw-r--r--test/src/json-tests.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/src/json-tests.el b/test/src/json-tests.el
index 8bd679b886e..911bc49730d 100644
--- a/test/src/json-tests.el
+++ b/test/src/json-tests.el
@@ -278,5 +278,13 @@ Test with both unibyte and multibyte strings."
:type 'no-catch)
(should (equal calls 1)))))
+(ert-deftest json-serialize/bignum ()
+ (skip-unless (fboundp 'json-serialize))
+ (should (equal (json-serialize (vector (1+ most-positive-fixnum)
+ (1- most-negative-fixnum)))
+ (format "[%d,%d]"
+ (1+ most-positive-fixnum)
+ (1- most-negative-fixnum)))))
+
(provide 'json-tests)
;;; json-tests.el ends here