summaryrefslogtreecommitdiff
path: root/test/src/json-tests.el
diff options
context:
space:
mode:
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 04f91f4abbc..542eec11bf3 100644
--- a/test/src/json-tests.el
+++ b/test/src/json-tests.el
@@ -117,6 +117,14 @@
(should (equal (json-parse-string input :object-type 'plist)
'(:abc [9 :false] :def :null)))))
+(ert-deftest json-parse-string/array ()
+ (skip-unless (fboundp 'json-parse-string))
+ (let ((input "[\"a\", 1, [\"b\", 2]]"))
+ (should (equal (json-parse-string input)
+ ["a" 1 ["b" 2]]))
+ (should (equal (json-parse-string input :array-type 'list)
+ '("a" 1 ("b" 2))))))
+
(ert-deftest json-parse-string/string ()
(skip-unless (fboundp 'json-parse-string))
(should-error (json-parse-string "[\"formfeed\f\"]") :type 'json-parse-error)