diff options
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/json-tests.el | 8 |
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 @@ | |||
| 117 | (should (equal (json-parse-string input :object-type 'plist) | 117 | (should (equal (json-parse-string input :object-type 'plist) |
| 118 | '(:abc [9 :false] :def :null))))) | 118 | '(:abc [9 :false] :def :null))))) |
| 119 | 119 | ||
| 120 | (ert-deftest json-parse-string/array () | ||
| 121 | (skip-unless (fboundp 'json-parse-string)) | ||
| 122 | (let ((input "[\"a\", 1, [\"b\", 2]]")) | ||
| 123 | (should (equal (json-parse-string input) | ||
| 124 | ["a" 1 ["b" 2]])) | ||
| 125 | (should (equal (json-parse-string input :array-type 'list) | ||
| 126 | '("a" 1 ("b" 2)))))) | ||
| 127 | |||
| 120 | (ert-deftest json-parse-string/string () | 128 | (ert-deftest json-parse-string/string () |
| 121 | (skip-unless (fboundp 'json-parse-string)) | 129 | (skip-unless (fboundp 'json-parse-string)) |
| 122 | (should-error (json-parse-string "[\"formfeed\f\"]") :type 'json-parse-error) | 130 | (should-error (json-parse-string "[\"formfeed\f\"]") :type 'json-parse-error) |