diff options
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/json-tests.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/test/src/json-tests.el b/test/src/json-tests.el index 551f8ac5fe4..100bf7bd39b 100644 --- a/test/src/json-tests.el +++ b/test/src/json-tests.el | |||
| @@ -54,13 +54,15 @@ | |||
| 54 | 54 | ||
| 55 | (ert-deftest json-parse-string/object () | 55 | (ert-deftest json-parse-string/object () |
| 56 | (skip-unless (fboundp 'json-parse-string)) | 56 | (skip-unless (fboundp 'json-parse-string)) |
| 57 | (let ((actual | 57 | (let ((input |
| 58 | (json-parse-string | 58 | "{ \"abc\" : [1, 2, true], \"def\" : null, \"abc\" : [9, false] }\n")) |
| 59 | "{ \"abc\" : [1, 2, true], \"def\" : null, \"abc\" : [9, false] }\n"))) | 59 | (let ((actual (json-parse-string input))) |
| 60 | (should (hash-table-p actual)) | 60 | (should (hash-table-p actual)) |
| 61 | (should (equal (hash-table-count actual) 2)) | 61 | (should (equal (hash-table-count actual) 2)) |
| 62 | (should (equal (cl-sort (map-pairs actual) #'string< :key #'car) | 62 | (should (equal (cl-sort (map-pairs actual) #'string< :key #'car) |
| 63 | '(("abc" . [9 :false]) ("def" . :null)))))) | 63 | '(("abc" . [9 :false]) ("def" . :null))))) |
| 64 | (should (equal (json-parse-string input :object-type 'alist) | ||
| 65 | '((abc . [9 :false]) (def . :null)))))) | ||
| 64 | 66 | ||
| 65 | (ert-deftest json-parse-string/string () | 67 | (ert-deftest json-parse-string/string () |
| 66 | (skip-unless (fboundp 'json-parse-string)) | 68 | (skip-unless (fboundp 'json-parse-string)) |