emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] feature/gnus-select 537ed97 114/218: Pass json-readtable-e


From: Andrew G Cohen
Subject: [Emacs-diffs] feature/gnus-select 537ed97 114/218: Pass json-readtable-error data as a list (bug#30489)
Date: Fri, 14 Dec 2018 03:35:12 -0500 (EST)

branch: feature/gnus-select
commit 537ed97e9cf8daca8967f11c3124c657a874c704
Author: Basil L. Contovounesios <address@hidden>
Commit: Andrew G Cohen <address@hidden>

    Pass json-readtable-error data as a list (bug#30489)
    
    * lisp/json.el (json-readtable-dispatch): Fix error data.
    * test/lisp/json-tests.el (test-json-read): Check error data is a
    list.
---
 lisp/json.el            | 2 +-
 test/lisp/json-tests.el | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/json.el b/lisp/json.el
index b03a482..d374f45 100644
--- a/lisp/json.el
+++ b/lisp/json.el
@@ -685,7 +685,7 @@ become JSON objects."
       (push (list c 'json-read-number) table))
     (pcase-dolist (`(,c . ,rest) table)
       (push `((eq ,char ,c) (,@rest)) res))
-    `(cond ,@res (t (signal 'json-readtable-error ,char)))))
+    `(cond ,@res (t (signal 'json-readtable-error (list ,char))))))
 
 (defun json-read ()
   "Parse and return the JSON object following point.
diff --git a/test/lisp/json-tests.el b/test/lisp/json-tests.el
index 47f8047..ea562e8 100644
--- a/test/lisp/json-tests.el
+++ b/test/lisp/json-tests.el
@@ -309,7 +309,8 @@ Point is moved to beginning of the buffer."
   (json-tests--with-temp-buffer ""
     (should-error (json-read) :type 'json-end-of-file))
   (json-tests--with-temp-buffer "xxx"
-    (should-error (json-read) :type 'json-readtable-error)))
+    (let ((err (should-error (json-read) :type 'json-readtable-error)))
+      (should (equal (cdr err) '(?x))))))
 
 (ert-deftest test-json-read-from-string ()
   (let ((json-string "{ \"a\": 1 }"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]