diff options
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/json-tests.el | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/test/src/json-tests.el b/test/src/json-tests.el index 5c9be20e957..b7c17a4cf10 100644 --- a/test/src/json-tests.el +++ b/test/src/json-tests.el | |||
| @@ -71,17 +71,16 @@ | |||
| 71 | (should-error (json-serialize '#1=((a . 1) . #1#)) :type 'circular-list) | 71 | (should-error (json-serialize '#1=((a . 1) . #1#)) :type 'circular-list) |
| 72 | (should-error (json-serialize '(#1=(a #1#)))) | 72 | (should-error (json-serialize '(#1=(a #1#)))) |
| 73 | 73 | ||
| 74 | (let ((json-serialize-use-plists t)) | 74 | (should (equal (json-serialize '(:abc [1 2 t] :def :null) t) |
| 75 | (should (equal (json-serialize '(:abc [1 2 t] :def :null)) | 75 | "{\"abc\":[1,2,true],\"def\":null}")) |
| 76 | "{\"abc\":[1,2,true],\"def\":null}")) | 76 | (should (equal (json-serialize '(abc [1 2 t] :def :null) t) |
| 77 | (should (equal (json-serialize '(abc [1 2 t] :def :null)) | 77 | "{\"abc\":[1,2,true],\"def\":null}")) |
| 78 | "{\"abc\":[1,2,true],\"def\":null}")) | 78 | (should-error (json-serialize '#1=(:a 1 . #1#) t) :type 'circular-list) |
| 79 | (should-error (json-serialize '#1=(:a 1 . #1#)) :type 'circular-list) | 79 | (should-error (json-serialize '((abc . 1)) t) :type 'wrong-type-argument) |
| 80 | (should-error (json-serialize '((abc . 1))) :type 'wrong-type-argument) | 80 | (should-error (json-serialize '(:foo bar (abc . 1)) t) |
| 81 | (should-error (json-serialize '(:foo bar (abc . 1))) | 81 | :type 'wrong-type-argument) |
| 82 | :type 'wrong-type-argument) | 82 | (should-error (json-serialize '(:foo bar :odd-numbered) t) |
| 83 | (should-error (json-serialize '(:foo bar :odd-numbered)) | 83 | :type 'wrong-type-argument)) |
| 84 | :type 'wrong-type-argument))) | ||
| 85 | 84 | ||
| 86 | (ert-deftest json-serialize/object-with-duplicate-keys () | 85 | (ert-deftest json-serialize/object-with-duplicate-keys () |
| 87 | (skip-unless (fboundp 'json-serialize)) | 86 | (skip-unless (fboundp 'json-serialize)) |