From unknown Sat Jun 21 03:06:27 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#21985 <21985@debbugs.gnu.org> To: bug#21985 <21985@debbugs.gnu.org> Subject: Status: 25.0.50; PATCH] Extend the test suite for json.el Reply-To: bug#21985 <21985@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:06:27 +0000 retitle 21985 25.0.50; PATCH] Extend the test suite for json.el reassign 21985 emacs submitter 21985 Simen Heggest=C3=B8yl severity 21985 wishlist tag 21985 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 22 16:30:55 2015 Received: (at submit) by debbugs.gnu.org; 22 Nov 2015 21:30:55 +0000 Received: from localhost ([127.0.0.1]:48596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a0cDl-0003fX-Is for submit@debbugs.gnu.org; Sun, 22 Nov 2015 16:30:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52746) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a0cDP-0003eu-Vn for submit@debbugs.gnu.org; Sun, 22 Nov 2015 16:30:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0cDN-0000n1-2v for submit@debbugs.gnu.org; Sun, 22 Nov 2015 16:30:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0cDM-0000mw-Se for submit@debbugs.gnu.org; Sun, 22 Nov 2015 16:30:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0cDK-0003di-Js for bug-gnu-emacs@gnu.org; Sun, 22 Nov 2015 16:30:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0cDH-0000mK-5l for bug-gnu-emacs@gnu.org; Sun, 22 Nov 2015 16:30:26 -0500 Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]:35240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0cDG-0000mG-Of for bug-gnu-emacs@gnu.org; Sun, 22 Nov 2015 16:30:23 -0500 Received: by lfdl133 with SMTP id l133so15750899lfd.2 for ; Sun, 22 Nov 2015 13:30:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:cc:message-id:mime-version:content-type; bh=XFDig5znshpmacj/BVM9HtWYzwVbATqTuKYVhXNZUMI=; b=pbGuLD/YByNiV8RtFIZsPabIFlDUjinpEPyJFmtGQcn/H4bshNcV98+zZA6p82m+Dh LJ32+YjvRQ44JJqiid+waWvhMkCkema3ttMCbbKeumJxuBe/NoFt8jEFF7thuRkPX0RE lZqMJreMz2A6zluwMxutWVOaeb+i+VEcZzHuLB0Wz4YBXDUWlr7oYid1rILfWi4x88Xs t7sScVbmorexukmKSi5p1bRuw7a7Lwb4fweE6BJPbd6cZu219HMmYrF5eQqzvKk+OwVy hCQMCrciArfF8bO1YhhrGx5P+tmPGX1qVSUaRo1t6Wml7zvALEZzmltd3gOXab58fz0h 8v1A== X-Received: by 10.25.21.151 with SMTP id 23mr7699243lfv.165.1448227821692; Sun, 22 Nov 2015 13:30:21 -0800 (PST) Received: from [192.168.100.5] (cm-84.210.143.4.getinternet.no. [84.210.143.4]) by smtp.gmail.com with ESMTPSA id tp5sm1360106lbb.27.2015.11.22.13.30.20 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 22 Nov 2015 13:30:20 -0800 (PST) Date: Sun, 22 Nov 2015 22:30:19 +0100 From: Simen =?iso-8859-1?q?Heggest=F8yl?= Subject: 25.0.50; PATCH] Extend the test suite for json.el To: bug-gnu-emacs@gnu.org Message-Id: <1448227819.17458.0@smtp.gmail.com> X-Mailer: geary/0.10.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-C2hVk1h1FxljcOswf6SI" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-C2hVk1h1FxljcOswf6SI Content-Type: multipart/alternative; boundary="=-rNgtrAANeuHEEEmAN/BT" --=-rNgtrAANeuHEEEmAN/BT Content-Type: text/plain; charset=utf-8; format=flowed Hi, I've tried to strengthen the test suite for json.el a bit. Most of the public functions have now received a corresponding test. I was unsure how to best test `json-encode' without duplicating what the other tests (`test-json-encode-string', `test-json-encode-keyword', and so on) already do test. -- Simen --=-rNgtrAANeuHEEEmAN/BT Content-Type: text/html; charset=utf-8
Hi,

I've tried to strengthen the test suite for json.el a bit. Most of the
public functions have now received a corresponding test.

I was unsure how to best test `json-encode' without duplicating what
the other tests (`test-json-encode-string',
`test-json-encode-keyword', and so on) already do test.

-- Simen

--=-rNgtrAANeuHEEEmAN/BT-- --=-C2hVk1h1FxljcOswf6SI Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Extend-the-test-suite-for-json.el.patch Content-Transfer-Encoding: quoted-printable >From 8eef0bf1c9af5fd1b14a4a6f7f6f37a240122547 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Simen=3D20Heggest=3DC3=3DB8yl?=3D Date: Sat, 14 Nov 2015 17:54:38 +0100 Subject: [PATCH] Extend the test suite for json.el * lisp/json.el (json-plist-p): Clarify docstring. * test/automated/json-tests.el (json-tests--with-temp-buffer): New macro. (test-json-join, test-json-alist-p) (test-json-plist-p, test-json-advance, test-json-peek) (test-json-pop, test-json-skip-whitespace) (test-json-read-keyword, test-json-encode-keyword) (test-json-read-number, test-json-encode-number) (test-json-read-escaped-char, test-json-read-string) (test-json-encode-string, test-json-encode-key) (test-json-new-object, test-json-add-to-object) (test-json-read-object, test-json-encode-list) (test-json-read-array, test-json-encode-array) (test-json-read, test-json-read-from-string): New tests. (json-read-simple-alist): Merged into `test-json-read-object'. (json-encode-string-with-special-chars): Merged into `test-json-encode-string'. (json-read-string-with-special-chars): Split into `test-json-encode-string' and `test-json-read-from-string'. --- lisp/json.el | 2 +- test/automated/json-tests.el | 290 +++++++++++++++++++++++++++++++++++++--= ---- 2 files changed, 252 insertions(+), 40 deletions(-) diff --git a/lisp/json.el b/lisp/json.el index 0214a3e..85827b5 100644 --- a/lisp/json.el +++ b/lisp/json.el @@ -149,7 +149,7 @@ json-alist-p (null list)) =20 (defun json-plist-p (list) - "Non-null if and only if LIST is a plist." + "Non-null if and only if LIST is a plist with keyword keys." (while (consp list) (setq list (if (and (keywordp (car list)) (consp (cdr list))) diff --git a/test/automated/json-tests.el b/test/automated/json-tests.el index 8f0cd6f..6a6a18d 100644 --- a/test/automated/json-tests.el +++ b/test/automated/json-tests.el @@ -22,6 +22,38 @@ (require 'ert) (require 'json) =20 +(defmacro json-tests--with-temp-buffer (content &rest body) + "Create a temporary buffer with CONTENT and evaluate BODY there. +Point is moved to beginning of the buffer." + (declare (indent 1)) + `(with-temp-buffer + (insert ,content) + (goto-char (point-min)) + ,@body)) + +;;; Utilities + +(ert-deftest test-json-join () + (should (equal (json-join '() ", ") "")) + (should (equal (json-join '("a" "b" "c") ", ") "a, b, c"))) + +(ert-deftest test-json-alist-p () + (should (json-alist-p '())) + (should (json-alist-p '((a 1) (b 2) (c 3)))) + (should (json-alist-p '((:a 1) (:b 2) (:c 3)))) + (should (json-alist-p '(("a" 1) ("b" 2) ("c" 3)))) + (should-not (json-alist-p '(:a :b :c))) + (should-not (json-alist-p '(:a 1 :b 2 :c 3))) + (should-not (json-alist-p '((:a 1) (:b 2) 3)))) + +(ert-deftest test-json-plist-p () + (should (json-plist-p '())) + (should (json-plist-p '(:a 1 :b 2 :c 3))) + (should-not (json-plist-p '(a 1 b 2 c 3))) + (should-not (json-plist-p '("a" 1 "b" 2 "c" 3))) + (should-not (json-plist-p '(:a :b :c))) + (should-not (json-plist-p '((:a 1) (:b 2) (:c 3))))) + (ert-deftest test-json-plist-reverse () (should (equal (json--plist-reverse '()) '())) (should (equal (json--plist-reverse '(:a 1)) '(:a 1))) @@ -34,49 +66,32 @@ (should (equal (json--plist-to-alist '(:a 1 :b 2 :c 3)) '((:a . 1) (:b . 2) (:c . 3))))) =20 -(ert-deftest test-json-encode-plist () - (let ((plist '(:a 1 :b 2))) - (should (equal (json-encode plist) "{\"a\":1,\"b\":2}")))) +(ert-deftest test-json-advance () + (json-tests--with-temp-buffer "{ \"a\": 1 }" + (json-advance 0) + (should (=3D (point) (point-min))) + (json-advance 3) + (should (=3D (point) (+ (point-min) 3))))) =20 -(ert-deftest json-encode-simple-alist () - (should (equal (json-encode '((a . 1) - (b . 2))) - "{\"a\":1,\"b\":2}"))) +(ert-deftest test-json-peek () + (json-tests--with-temp-buffer "" + (should (eq (json-peek) :json-eof))) + (json-tests--with-temp-buffer "{ \"a\": 1 }" + (should (equal (json-peek) ?{)))) =20 -(ert-deftest test-json-encode-hash-table () - (let ((hash-table (make-hash-table)) - (json-encoding-object-sort-predicate 'string<)) - (puthash :a 1 hash-table) - (puthash :b 2 hash-table) - (puthash :c 3 hash-table) - (should (equal (json-encode hash-table) - "{\"a\":1,\"b\":2,\"c\":3}")))) +(ert-deftest test-json-pop () + (json-tests--with-temp-buffer "" + (should-error (json-pop) :type 'json-end-of-file)) + (json-tests--with-temp-buffer "{ \"a\": 1 }" + (should (equal (json-pop) ?{)) + (should (=3D (point) (+ (point-min) 1))))) =20 -(ert-deftest test-json-encode-alist-with-sort-predicate () - (let ((alist '((:c . 3) (:a . 1) (:b . 2))) - (json-encoding-object-sort-predicate 'string<)) - (should (equal (json-encode alist) "{\"a\":1,\"b\":2,\"c\":3}")))) +(ert-deftest test-json-skip-whitespace () + (json-tests--with-temp-buffer "\t\r\n\f\b { \"a\": 1 }" + (json-skip-whitespace) + (should (equal (char-after (point)) ?{)))) =20 -(ert-deftest test-json-encode-plist-with-sort-predicate () - (let ((plist '(:c 3 :a 1 :b 2)) - (json-encoding-object-sort-predicate 'string<)) - (should (equal (json-encode plist) "{\"a\":1,\"b\":2,\"c\":3}")))) - -(ert-deftest json-read-simple-alist () - (let ((json-object-type 'alist)) - (should (equal (json-read-from-string "{\"a\": 1, \"b\": 2}") - '((a . 1) - (b . 2)))))) - -(ert-deftest json-encode-string-with-special-chars () - (should (equal (json-encode-string "a\n\fb") - "\"a\\n\\fb\"")) - (should (equal (json-encode-string "\nasd=D1=84=D1=8B=D0=B2\u001f\u007ff= gh\t") - "\"\\nasd=D1=84=D1=8B=D0=B2\\u001f\u007ffgh\\t\""))) - -(ert-deftest json-read-string-with-special-chars () - (should (equal (json-read-from-string "\"\\nasd\\u0444\\u044b\\u0432fgh\= \t\"") - "\nasd=D1=84=D1=8B=D0=B2fgh\t"))) +;;; Paths =20 (ert-deftest test-json-path-to-position-with-objects () (let* ((json-string "{\"foo\": {\"bar\": {\"baz\": \"value\"}}}") @@ -97,5 +112,202 @@ (matched-path (json-path-to-position 5 json-string))) (should (null matched-path)))) =20 +;;; Keywords + +(ert-deftest test-json-read-keyword () + (json-tests--with-temp-buffer "true" + (should (json-read-keyword "true"))) + (json-tests--with-temp-buffer "true" + (should-error + (json-read-keyword "false") :type 'json-unknown-keyword)) + (json-tests--with-temp-buffer "foo" + (should-error + (json-read-keyword "foo") :type 'json-unknown-keyword))) + +(ert-deftest test-json-encode-keyword () + (should (equal (json-encode-keyword t) "true")) + (should (equal (json-encode-keyword json-false) "false")) + (should (equal (json-encode-keyword json-null) "null"))) + +;;; Numbers + +(ert-deftest test-json-read-number () + (json-tests--with-temp-buffer "3" + (should (=3D (json-read-number) 3))) + (json-tests--with-temp-buffer "-5" + (should (=3D (json-read-number) -5))) + (json-tests--with-temp-buffer "123.456" + (should (=3D (json-read-number) 123.456))) + (json-tests--with-temp-buffer "1e3" + (should (=3D (json-read-number) 1e3))) + (json-tests--with-temp-buffer "2e+3" + (should (=3D (json-read-number) 2e3))) + (json-tests--with-temp-buffer "3E3" + (should (=3D (json-read-number) 3e3))) + (json-tests--with-temp-buffer "1e-7" + (should (=3D (json-read-number) 1e-7))) + (json-tests--with-temp-buffer "abc" + (should-error (json-read-number) :type 'json-number-format))) + +(ert-deftest test-json-encode-number () + (should (equal (json-encode-number 3) "3")) + (should (equal (json-encode-number -5) "-5")) + (should (equal (json-encode-number 123.456) "123.456"))) + +;; Strings + +(ert-deftest test-json-read-escaped-char () + (json-tests--with-temp-buffer "\\\"" + (should (equal (json-read-escaped-char) ?\")))) + +(ert-deftest test-json-read-string () + (json-tests--with-temp-buffer "\"foo \\\"bar\\\"\"" + (should (equal (json-read-string) "foo \"bar\""))) + (json-tests--with-temp-buffer "\"abc=CE=B1=CE=B2=CE=B3\"" + (should (equal (json-read-string) "abc=CE=B1=CE=B2=CE=B3"))) + (json-tests--with-temp-buffer "\"\\nasd\\u0444\\u044b\\u0432fgh\\t\"" + (should (equal (json-read-string) "\nasd=D1=84=D1=8B=D0=B2fgh\t"))) + (json-tests--with-temp-buffer "foo" + (should-error (json-read-string) :type 'json-string-format))) + +(ert-deftest test-json-encode-string () + (should (equal (json-encode-string "foo") "\"foo\"")) + (should (equal (json-encode-string "a\n\fb") "\"a\\n\\fb\"")) + (should (equal (json-encode-string "\nasd=D1=84=D1=8B=D0=B2\u001f\u007ff= gh\t") + "\"\\nasd=D1=84=D1=8B=D0=B2\\u001f\u007ffgh\\t\""))) + +(ert-deftest test-json-encode-key () + (should (equal (json-encode-key "foo") "\"foo\"")) + (should (equal (json-encode-key 'foo) "\"foo\"")) + (should (equal (json-encode-key :foo) "\"foo\"")) + (should-error (json-encode-key 5) :type 'json-key-format) + (should-error (json-encode-key ["foo"]) :type 'json-key-format) + (should-error (json-encode-key '("foo")) :type 'json-key-format)) + +;;; Objects + +(ert-deftest test-json-new-object () + (let ((json-object-type 'alist)) + (should (equal (json-new-object) '()))) + (let ((json-object-type 'plist)) + (should (equal (json-new-object) '()))) + (let* ((json-object-type 'hash-table) + (json-object (json-new-object))) + (should (hash-table-p json-object)) + (should (=3D (hash-table-count json-object) 0)))) + +(ert-deftest test-json-add-to-object () + (let* ((json-object-type 'alist) + (json-key-type nil) + (obj (json-new-object))) + (setq obj (json-add-to-object obj "a" 1)) + (setq obj (json-add-to-object obj "b" 2)) + (should (equal (assq 'a obj) '(a . 1))) + (should (equal (assq 'b obj) '(b . 2)))) + (let* ((json-object-type 'plist) + (json-key-type nil) + (obj (json-new-object))) + (setq obj (json-add-to-object obj "a" 1)) + (setq obj (json-add-to-object obj "b" 2)) + (should (=3D (plist-get obj :a) 1)) + (should (=3D (plist-get obj :b) 2))) + (let* ((json-object-type 'hash-table) + (json-key-type nil) + (obj (json-new-object))) + (setq obj (json-add-to-object obj "a" 1)) + (setq obj (json-add-to-object obj "b" 2)) + (should (=3D (gethash "a" obj) 1)) + (should (=3D (gethash "b" obj) 2)))) + +(ert-deftest test-json-read-object () + (json-tests--with-temp-buffer "{ \"a\": 1, \"b\": 2 }" + (let ((json-object-type 'alist)) + (should (equal (json-read-object) '((a . 1) (b . 2)))))) + (json-tests--with-temp-buffer "{ \"a\": 1, \"b\": 2 }" + (let ((json-object-type 'plist)) + (should (equal (json-read-object) '(:a 1 :b 2))))) + (json-tests--with-temp-buffer "{ \"a\": 1, \"b\": 2 }" + (let* ((json-object-type 'hash-table) + (hash-table (json-read-object))) + (should (=3D (gethash "a" hash-table) 1)) + (should (=3D (gethash "b" hash-table) 2)))) + (json-tests--with-temp-buffer "{ \"a\": 1 \"b\": 2 }" + (should-error (json-read-object) :type 'json-object-format))) + +(ert-deftest test-json-encode-hash-table () + (let ((hash-table (make-hash-table)) + (json-encoding-object-sort-predicate 'string<) + (json-encoding-pretty-print nil)) + (puthash :a 1 hash-table) + (puthash :b 2 hash-table) + (puthash :c 3 hash-table) + (should (equal (json-encode hash-table) + "{\"a\":1,\"b\":2,\"c\":3}")))) + +(ert-deftest json-encode-simple-alist () + (let ((json-encoding-pretty-print nil)) + (should (equal (json-encode '((a . 1) (b . 2))) + "{\"a\":1,\"b\":2}")))) + +(ert-deftest test-json-encode-plist () + (let ((plist '(:a 1 :b 2)) + (json-encoding-pretty-print nil)) + (should (equal (json-encode plist) "{\"a\":1,\"b\":2}")))) + +(ert-deftest test-json-encode-plist-with-sort-predicate () + (let ((plist '(:c 3 :a 1 :b 2)) + (json-encoding-object-sort-predicate 'string<) + (json-encoding-pretty-print nil)) + (should (equal (json-encode plist) "{\"a\":1,\"b\":2,\"c\":3}")))) + +(ert-deftest test-json-encode-alist-with-sort-predicate () + (let ((alist '((:c . 3) (:a . 1) (:b . 2))) + (json-encoding-object-sort-predicate 'string<) + (json-encoding-pretty-print nil)) + (should (equal (json-encode alist) "{\"a\":1,\"b\":2,\"c\":3}")))) + +(ert-deftest test-json-encode-list () + (let ((json-encoding-pretty-print nil)) + (should (equal (json-encode-list '(:a 1 :b 2)) + "{\"a\":1,\"b\":2}")) + (should (equal (json-encode-list '((:a . 1) (:b . 2))) + "{\"a\":1,\"b\":2}")) + (should (equal (json-encode-list '(1 2 3 4)) "[1,2,3,4]")))) + +;;; Arrays + +(ert-deftest test-json-read-array () + (let ((json-array-type 'vector)) + (json-tests--with-temp-buffer "[1, 2, \"a\", \"b\"]" + (should (equal (json-read-array) [1 2 "a" "b"])))) + (let ((json-array-type 'list)) + (json-tests--with-temp-buffer "[1, 2, \"a\", \"b\"]" + (should (equal (json-read-array) '(1 2 "a" "b"))))) + (json-tests--with-temp-buffer "[1 2]" + (should-error (json-read-array) :type 'json-error))) + +(ert-deftest test-json-encode-array () + (let ((json-encoding-pretty-print nil)) + (should (equal (json-encode-array [1 2 "a" "b"]) + "[1,2,\"a\",\"b\"]")))) + +;;; Reader + +(ert-deftest test-json-read () + (json-tests--with-temp-buffer "{ \"a\": 1 }" + ;; We don't care exactly what the return value is (that is tested + ;; in `test-json-read-object'), but it should parse without error. + (should (json-read))) + (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))) + +(ert-deftest test-json-read-from-string () + (let ((json-string "{ \"a\": 1 }")) + (json-tests--with-temp-buffer json-string + (should (equal (json-read-from-string json-string) + (json-read)))))) + (provide 'json-tests) ;;; json-tests.el ends here --=20 2.6.2 = --=-C2hVk1h1FxljcOswf6SI-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 22 18:15:30 2015 Received: (at 21985) by debbugs.gnu.org; 22 Nov 2015 23:15:30 +0000 Received: from localhost ([127.0.0.1]:48647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a0dr0-0006Lf-7j for submit@debbugs.gnu.org; Sun, 22 Nov 2015 18:15:30 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36105) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a0dqf-0006LC-Re for 21985@debbugs.gnu.org; Sun, 22 Nov 2015 18:15:28 -0500 Received: by wmww144 with SMTP id w144so76665202wmw.1 for <21985@debbugs.gnu.org>; Sun, 22 Nov 2015 15:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=MWKLhdS9e6v0BuiB2GA/5BWiRHm8PrpJR+UwlUm5NqY=; b=P9j2b7uSdF9GCutwKJikOIsK2Ci4TVUB1pTJAU4JN9glB2x4GxAWwx1/UPF6MFL5PJ svSosO1+YbNrwnBWRP3vaQ57neoWLR9Krk7u7x5qb1uakMsinRdGgv/7Gz/qh93wqevU 4251GojL95C/pDRCyvbBT3OPwVdQdls5z1PyyX7PQds04dOvZ1qAg14Et8BGhT0+Cj+I w71qlQNgjkPjNY7i08hi2pevho9rSBEAqN0vlLR9OAzba9u+V0jppXlPPXxWnR7PrglG TUQqbXlb5l9KgjhIWDop/sSwkxrWKJzBXiyFYmpcT2RM2VNdsowLiQXAghzpw0cQR7ns oLhA== X-Received: by 10.194.84.174 with SMTP id a14mr27708821wjz.52.1448234109174; Sun, 22 Nov 2015 15:15:09 -0800 (PST) Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id m11sm10412917wma.5.2015.11.22.15.15.07 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 22 Nov 2015 15:15:08 -0800 (PST) Subject: Re: bug#21985: 25.0.50; PATCH] Extend the test suite for json.el To: =?UTF-8?Q?Simen_Heggest=c3=b8yl?= , 21985@debbugs.gnu.org References: <1448227819.17458.0@smtp.gmail.com> From: Dmitry Gutov Message-ID: <56524C7B.9010500@yandex.ru> Date: Mon, 23 Nov 2015 01:15:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0 MIME-Version: 1.0 In-Reply-To: <1448227819.17458.0@smtp.gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21985 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 11/22/2015 11:30 PM, Simen Heggestøyl wrote: > I was unsure how to best test `json-encode' without duplicating what > the other tests (`test-json-encode-string', > `test-json-encode-keyword', and so on) already do test. IMO, there's no too much need to exhaustively test `json-encode', aside from one encode test (with any value), one decode test, and maybe one try-to-encode-something-unusual-and-end-up-with-an-error test. Testing all contents of json-readtable would seem excessive to me. But hey, if we miscalculate, we can add more tests as we fix regressions, later. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 24 15:25:39 2015 Received: (at 21985) by debbugs.gnu.org; 24 Nov 2015 20:25:40 +0000 Received: from localhost ([127.0.0.1]:51671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a1K9g-0008Hq-JI for submit@debbugs.gnu.org; Tue, 24 Nov 2015 15:25:37 -0500 Received: from mail-lf0-f41.google.com ([209.85.215.41]:34484) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a1K9d-0008Hh-9X for 21985@debbugs.gnu.org; Tue, 24 Nov 2015 15:25:34 -0500 Received: by lffu14 with SMTP id u14so36007555lff.1 for <21985@debbugs.gnu.org>; Tue, 24 Nov 2015 12:25:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:cc:message-id:in-reply-to:references :mime-version:content-type; bh=0wxGqiQNdyI+p/ewFJ19m3avYPBTD9mlXaB3GkrRp+o=; b=hXf7tBLZ+0c5WdLEJqBNVX+Z2WEuLGrnR1dkMe5FGIxHdkLxEvNPrjzLADiOQO8rn3 ag+qrS61rHAFPaoK8j7ilv0pflgG/7mgfjfd1ikpwuPv5v+EUfTOZ9+Ys3KgVyM3kMua POCB5vDOb7timLT5qZbs8HQTPjVh7az2O4K+dwMiWeXWupQzibm/4h320cKlZKxlm/xx hVaGghDsNBZbKa7GCRdnp9y3ZM85LEIXnLkEnBoBQAQ7N7Zkv0EKM2nSUpRoKTZmMq4y Uodd3+CLKlhfgJNSZQMD0RpyyN3DgXQrhYO53Tvd4pnmNHVthvVN+JCCmhYwaS5/F8eE HrpA== X-Received: by 10.25.135.195 with SMTP id j186mr12025789lfd.141.1448396732378; Tue, 24 Nov 2015 12:25:32 -0800 (PST) Received: from [192.168.100.5] (cm-84.210.143.4.getinternet.no. [84.210.143.4]) by smtp.gmail.com with ESMTPSA id s18sm2916923lfs.13.2015.11.24.12.25.30 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Nov 2015 12:25:31 -0800 (PST) Date: Tue, 24 Nov 2015 21:25:29 +0100 From: Simen =?iso-8859-1?q?Heggest=F8yl?= Subject: Re: bug#21985: 25.0.50; PATCH] Extend the test suite for json.el To: Dmitry Gutov Message-Id: <1448396729.6004.1@smtp.gmail.com> In-Reply-To: <56524C7B.9010500@yandex.ru> References: <1448227819.17458.0@smtp.gmail.com> <56524C7B.9010500@yandex.ru> X-Mailer: geary/0.10.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-KlrAuytk2iZpbPMSut6a" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21985 Cc: 21985@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-KlrAuytk2iZpbPMSut6a Content-Type: multipart/alternative; boundary="=-dTyTZ150eO17Iqmj4amn" --=-dTyTZ150eO17Iqmj4amn Content-Type: text/plain; charset=utf-8; format=flowed On Mon, Nov 23, 2015 at 12:15 AM, Dmitry Gutov wrote: > IMO, there's no too much need to exhaustively test `json-encode', > aside from one encode test (with any value), one decode test, and > maybe one try-to-encode-something-unusual-and-end-up-with-an-error > test. > > Testing all contents of json-readtable would seem excessive to me. > But hey, if we miscalculate, we can add more tests as we fix > regressions, later. Alright! I've attached an updated patch. -- Simen --=-dTyTZ150eO17Iqmj4amn Content-Type: text/html; charset=utf-8 On Mon, Nov 23, 2015 at 12:15 AM, Dmitry Gutov <dgutov@yandex.ru> wrote:
IMO, there's no too much need to exhaustively test `json-encode', aside from one encode test (with any value), one decode test, and maybe one try-to-encode-something-unusual-and-end-up-with-an-error test. Testing all contents of json-readtable would seem excessive to me. But hey, if we miscalculate, we can add more tests as we fix regressions, later.

Alright!

I've attached an updated patch.

-- Simen
--=-dTyTZ150eO17Iqmj4amn-- --=-KlrAuytk2iZpbPMSut6a Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Extend-the-test-suite-for-json.el.patch Content-Transfer-Encoding: quoted-printable >From 10576e0204fc16ba165a6a5d6fc46d96cf7be081 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Simen=3D20Heggest=3DC3=3DB8yl?=3D Date: Sat, 14 Nov 2015 17:54:38 +0100 Subject: [PATCH] Extend the test suite for json.el * lisp/json.el (json-plist-p): Clarify docstring. * test/automated/json-tests.el (json-tests--with-temp-buffer): New macro. (test-json-join, test-json-alist-p) (test-json-plist-p, test-json-advance, test-json-peek) (test-json-pop, test-json-skip-whitespace) (test-json-read-keyword, test-json-encode-keyword) (test-json-read-number, test-json-encode-number) (test-json-read-escaped-char, test-json-read-string) (test-json-encode-string, test-json-encode-key) (test-json-new-object, test-json-add-to-object) (test-json-read-object, test-json-encode-list) (test-json-read-array, test-json-encode-array) (test-json-read, test-json-read-from-string) (test-json-encode): New tests. (json-read-simple-alist): Merged into `test-json-read-object'. (json-encode-string-with-special-chars): Merged into `test-json-encode-string'. (json-read-string-with-special-chars): Split into `test-json-encode-string' and `test-json-read-from-string'. --- lisp/json.el | 2 +- test/automated/json-tests.el | 297 +++++++++++++++++++++++++++++++++++++--= ---- 2 files changed, 259 insertions(+), 40 deletions(-) diff --git a/lisp/json.el b/lisp/json.el index 0214a3e..85827b5 100644 --- a/lisp/json.el +++ b/lisp/json.el @@ -149,7 +149,7 @@ json-alist-p (null list)) =20 (defun json-plist-p (list) - "Non-null if and only if LIST is a plist." + "Non-null if and only if LIST is a plist with keyword keys." (while (consp list) (setq list (if (and (keywordp (car list)) (consp (cdr list))) diff --git a/test/automated/json-tests.el b/test/automated/json-tests.el index 8f0cd6f..bb043dc 100644 --- a/test/automated/json-tests.el +++ b/test/automated/json-tests.el @@ -22,6 +22,38 @@ (require 'ert) (require 'json) =20 +(defmacro json-tests--with-temp-buffer (content &rest body) + "Create a temporary buffer with CONTENT and evaluate BODY there. +Point is moved to beginning of the buffer." + (declare (indent 1)) + `(with-temp-buffer + (insert ,content) + (goto-char (point-min)) + ,@body)) + +;;; Utilities + +(ert-deftest test-json-join () + (should (equal (json-join '() ", ") "")) + (should (equal (json-join '("a" "b" "c") ", ") "a, b, c"))) + +(ert-deftest test-json-alist-p () + (should (json-alist-p '())) + (should (json-alist-p '((a 1) (b 2) (c 3)))) + (should (json-alist-p '((:a 1) (:b 2) (:c 3)))) + (should (json-alist-p '(("a" 1) ("b" 2) ("c" 3)))) + (should-not (json-alist-p '(:a :b :c))) + (should-not (json-alist-p '(:a 1 :b 2 :c 3))) + (should-not (json-alist-p '((:a 1) (:b 2) 3)))) + +(ert-deftest test-json-plist-p () + (should (json-plist-p '())) + (should (json-plist-p '(:a 1 :b 2 :c 3))) + (should-not (json-plist-p '(a 1 b 2 c 3))) + (should-not (json-plist-p '("a" 1 "b" 2 "c" 3))) + (should-not (json-plist-p '(:a :b :c))) + (should-not (json-plist-p '((:a 1) (:b 2) (:c 3))))) + (ert-deftest test-json-plist-reverse () (should (equal (json--plist-reverse '()) '())) (should (equal (json--plist-reverse '(:a 1)) '(:a 1))) @@ -34,49 +66,32 @@ (should (equal (json--plist-to-alist '(:a 1 :b 2 :c 3)) '((:a . 1) (:b . 2) (:c . 3))))) =20 -(ert-deftest test-json-encode-plist () - (let ((plist '(:a 1 :b 2))) - (should (equal (json-encode plist) "{\"a\":1,\"b\":2}")))) - -(ert-deftest json-encode-simple-alist () - (should (equal (json-encode '((a . 1) - (b . 2))) - "{\"a\":1,\"b\":2}"))) - -(ert-deftest test-json-encode-hash-table () - (let ((hash-table (make-hash-table)) - (json-encoding-object-sort-predicate 'string<)) - (puthash :a 1 hash-table) - (puthash :b 2 hash-table) - (puthash :c 3 hash-table) - (should (equal (json-encode hash-table) - "{\"a\":1,\"b\":2,\"c\":3}")))) - -(ert-deftest test-json-encode-alist-with-sort-predicate () - (let ((alist '((:c . 3) (:a . 1) (:b . 2))) - (json-encoding-object-sort-predicate 'string<)) - (should (equal (json-encode alist) "{\"a\":1,\"b\":2,\"c\":3}")))) +(ert-deftest test-json-advance () + (json-tests--with-temp-buffer "{ \"a\": 1 }" + (json-advance 0) + (should (=3D (point) (point-min))) + (json-advance 3) + (should (=3D (point) (+ (point-min) 3))))) =20 -(ert-deftest test-json-encode-plist-with-sort-predicate () - (let ((plist '(:c 3 :a 1 :b 2)) - (json-encoding-object-sort-predicate 'string<)) - (should (equal (json-encode plist) "{\"a\":1,\"b\":2,\"c\":3}")))) +(ert-deftest test-json-peek () + (json-tests--with-temp-buffer "" + (should (eq (json-peek) :json-eof))) + (json-tests--with-temp-buffer "{ \"a\": 1 }" + (should (equal (json-peek) ?{)))) =20 -(ert-deftest json-read-simple-alist () - (let ((json-object-type 'alist)) - (should (equal (json-read-from-string "{\"a\": 1, \"b\": 2}") - '((a . 1) - (b . 2)))))) +(ert-deftest test-json-pop () + (json-tests--with-temp-buffer "" + (should-error (json-pop) :type 'json-end-of-file)) + (json-tests--with-temp-buffer "{ \"a\": 1 }" + (should (equal (json-pop) ?{)) + (should (=3D (point) (+ (point-min) 1))))) =20 -(ert-deftest json-encode-string-with-special-chars () - (should (equal (json-encode-string "a\n\fb") - "\"a\\n\\fb\"")) - (should (equal (json-encode-string "\nasd=D1=84=D1=8B=D0=B2\u001f\u007ff= gh\t") - "\"\\nasd=D1=84=D1=8B=D0=B2\\u001f\u007ffgh\\t\""))) +(ert-deftest test-json-skip-whitespace () + (json-tests--with-temp-buffer "\t\r\n\f\b { \"a\": 1 }" + (json-skip-whitespace) + (should (equal (char-after (point)) ?{)))) =20 -(ert-deftest json-read-string-with-special-chars () - (should (equal (json-read-from-string "\"\\nasd\\u0444\\u044b\\u0432fgh\= \t\"") - "\nasd=D1=84=D1=8B=D0=B2fgh\t"))) +;;; Paths =20 (ert-deftest test-json-path-to-position-with-objects () (let* ((json-string "{\"foo\": {\"bar\": {\"baz\": \"value\"}}}") @@ -97,5 +112,209 @@ (matched-path (json-path-to-position 5 json-string))) (should (null matched-path)))) =20 +;;; Keywords + +(ert-deftest test-json-read-keyword () + (json-tests--with-temp-buffer "true" + (should (json-read-keyword "true"))) + (json-tests--with-temp-buffer "true" + (should-error + (json-read-keyword "false") :type 'json-unknown-keyword)) + (json-tests--with-temp-buffer "foo" + (should-error + (json-read-keyword "foo") :type 'json-unknown-keyword))) + +(ert-deftest test-json-encode-keyword () + (should (equal (json-encode-keyword t) "true")) + (should (equal (json-encode-keyword json-false) "false")) + (should (equal (json-encode-keyword json-null) "null"))) + +;;; Numbers + +(ert-deftest test-json-read-number () + (json-tests--with-temp-buffer "3" + (should (=3D (json-read-number) 3))) + (json-tests--with-temp-buffer "-5" + (should (=3D (json-read-number) -5))) + (json-tests--with-temp-buffer "123.456" + (should (=3D (json-read-number) 123.456))) + (json-tests--with-temp-buffer "1e3" + (should (=3D (json-read-number) 1e3))) + (json-tests--with-temp-buffer "2e+3" + (should (=3D (json-read-number) 2e3))) + (json-tests--with-temp-buffer "3E3" + (should (=3D (json-read-number) 3e3))) + (json-tests--with-temp-buffer "1e-7" + (should (=3D (json-read-number) 1e-7))) + (json-tests--with-temp-buffer "abc" + (should-error (json-read-number) :type 'json-number-format))) + +(ert-deftest test-json-encode-number () + (should (equal (json-encode-number 3) "3")) + (should (equal (json-encode-number -5) "-5")) + (should (equal (json-encode-number 123.456) "123.456"))) + +;; Strings + +(ert-deftest test-json-read-escaped-char () + (json-tests--with-temp-buffer "\\\"" + (should (equal (json-read-escaped-char) ?\")))) + +(ert-deftest test-json-read-string () + (json-tests--with-temp-buffer "\"foo \\\"bar\\\"\"" + (should (equal (json-read-string) "foo \"bar\""))) + (json-tests--with-temp-buffer "\"abc=CE=B1=CE=B2=CE=B3\"" + (should (equal (json-read-string) "abc=CE=B1=CE=B2=CE=B3"))) + (json-tests--with-temp-buffer "\"\\nasd\\u0444\\u044b\\u0432fgh\\t\"" + (should (equal (json-read-string) "\nasd=D1=84=D1=8B=D0=B2fgh\t"))) + (json-tests--with-temp-buffer "foo" + (should-error (json-read-string) :type 'json-string-format))) + +(ert-deftest test-json-encode-string () + (should (equal (json-encode-string "foo") "\"foo\"")) + (should (equal (json-encode-string "a\n\fb") "\"a\\n\\fb\"")) + (should (equal (json-encode-string "\nasd=D1=84=D1=8B=D0=B2\u001f\u007ff= gh\t") + "\"\\nasd=D1=84=D1=8B=D0=B2\\u001f\u007ffgh\\t\""))) + +(ert-deftest test-json-encode-key () + (should (equal (json-encode-key "foo") "\"foo\"")) + (should (equal (json-encode-key 'foo) "\"foo\"")) + (should (equal (json-encode-key :foo) "\"foo\"")) + (should-error (json-encode-key 5) :type 'json-key-format) + (should-error (json-encode-key ["foo"]) :type 'json-key-format) + (should-error (json-encode-key '("foo")) :type 'json-key-format)) + +;;; Objects + +(ert-deftest test-json-new-object () + (let ((json-object-type 'alist)) + (should (equal (json-new-object) '()))) + (let ((json-object-type 'plist)) + (should (equal (json-new-object) '()))) + (let* ((json-object-type 'hash-table) + (json-object (json-new-object))) + (should (hash-table-p json-object)) + (should (=3D (hash-table-count json-object) 0)))) + +(ert-deftest test-json-add-to-object () + (let* ((json-object-type 'alist) + (json-key-type nil) + (obj (json-new-object))) + (setq obj (json-add-to-object obj "a" 1)) + (setq obj (json-add-to-object obj "b" 2)) + (should (equal (assq 'a obj) '(a . 1))) + (should (equal (assq 'b obj) '(b . 2)))) + (let* ((json-object-type 'plist) + (json-key-type nil) + (obj (json-new-object))) + (setq obj (json-add-to-object obj "a" 1)) + (setq obj (json-add-to-object obj "b" 2)) + (should (=3D (plist-get obj :a) 1)) + (should (=3D (plist-get obj :b) 2))) + (let* ((json-object-type 'hash-table) + (json-key-type nil) + (obj (json-new-object))) + (setq obj (json-add-to-object obj "a" 1)) + (setq obj (json-add-to-object obj "b" 2)) + (should (=3D (gethash "a" obj) 1)) + (should (=3D (gethash "b" obj) 2)))) + +(ert-deftest test-json-read-object () + (json-tests--with-temp-buffer "{ \"a\": 1, \"b\": 2 }" + (let ((json-object-type 'alist)) + (should (equal (json-read-object) '((a . 1) (b . 2)))))) + (json-tests--with-temp-buffer "{ \"a\": 1, \"b\": 2 }" + (let ((json-object-type 'plist)) + (should (equal (json-read-object) '(:a 1 :b 2))))) + (json-tests--with-temp-buffer "{ \"a\": 1, \"b\": 2 }" + (let* ((json-object-type 'hash-table) + (hash-table (json-read-object))) + (should (=3D (gethash "a" hash-table) 1)) + (should (=3D (gethash "b" hash-table) 2)))) + (json-tests--with-temp-buffer "{ \"a\": 1 \"b\": 2 }" + (should-error (json-read-object) :type 'json-object-format))) + +(ert-deftest test-json-encode-hash-table () + (let ((hash-table (make-hash-table)) + (json-encoding-object-sort-predicate 'string<) + (json-encoding-pretty-print nil)) + (puthash :a 1 hash-table) + (puthash :b 2 hash-table) + (puthash :c 3 hash-table) + (should (equal (json-encode hash-table) + "{\"a\":1,\"b\":2,\"c\":3}")))) + +(ert-deftest json-encode-simple-alist () + (let ((json-encoding-pretty-print nil)) + (should (equal (json-encode '((a . 1) (b . 2))) + "{\"a\":1,\"b\":2}")))) + +(ert-deftest test-json-encode-plist () + (let ((plist '(:a 1 :b 2)) + (json-encoding-pretty-print nil)) + (should (equal (json-encode plist) "{\"a\":1,\"b\":2}")))) + +(ert-deftest test-json-encode-plist-with-sort-predicate () + (let ((plist '(:c 3 :a 1 :b 2)) + (json-encoding-object-sort-predicate 'string<) + (json-encoding-pretty-print nil)) + (should (equal (json-encode plist) "{\"a\":1,\"b\":2,\"c\":3}")))) + +(ert-deftest test-json-encode-alist-with-sort-predicate () + (let ((alist '((:c . 3) (:a . 1) (:b . 2))) + (json-encoding-object-sort-predicate 'string<) + (json-encoding-pretty-print nil)) + (should (equal (json-encode alist) "{\"a\":1,\"b\":2,\"c\":3}")))) + +(ert-deftest test-json-encode-list () + (let ((json-encoding-pretty-print nil)) + (should (equal (json-encode-list '(:a 1 :b 2)) + "{\"a\":1,\"b\":2}")) + (should (equal (json-encode-list '((:a . 1) (:b . 2))) + "{\"a\":1,\"b\":2}")) + (should (equal (json-encode-list '(1 2 3 4)) "[1,2,3,4]")))) + +;;; Arrays + +(ert-deftest test-json-read-array () + (let ((json-array-type 'vector)) + (json-tests--with-temp-buffer "[1, 2, \"a\", \"b\"]" + (should (equal (json-read-array) [1 2 "a" "b"])))) + (let ((json-array-type 'list)) + (json-tests--with-temp-buffer "[1, 2, \"a\", \"b\"]" + (should (equal (json-read-array) '(1 2 "a" "b"))))) + (json-tests--with-temp-buffer "[1 2]" + (should-error (json-read-array) :type 'json-error))) + +(ert-deftest test-json-encode-array () + (let ((json-encoding-pretty-print nil)) + (should (equal (json-encode-array [1 2 "a" "b"]) + "[1,2,\"a\",\"b\"]")))) + +;;; Reader + +(ert-deftest test-json-read () + (json-tests--with-temp-buffer "{ \"a\": 1 }" + ;; We don't care exactly what the return value is (that is tested + ;; in `test-json-read-object'), but it should parse without error. + (should (json-read))) + (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))) + +(ert-deftest test-json-read-from-string () + (let ((json-string "{ \"a\": 1 }")) + (json-tests--with-temp-buffer json-string + (should (equal (json-read-from-string json-string) + (json-read)))))) + +;;; JSON encoder + +(ert-deftest test-json-encode () + (should (equal (json-encode "foo") "\"foo\"")) + (with-temp-buffer + (should-error (json-encode (current-buffer)) :type 'json-error))) + (provide 'json-tests) ;;; json-tests.el ends here --=20 2.6.2 = --=-KlrAuytk2iZpbPMSut6a-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 24 15:54:00 2015 Received: (at 21985) by debbugs.gnu.org; 24 Nov 2015 20:54:00 +0000 Received: from localhost ([127.0.0.1]:51689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a1Kb9-0000ge-Ul for submit@debbugs.gnu.org; Tue, 24 Nov 2015 15:54:00 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:32925) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a1Kb7-0000gX-VD for 21985@debbugs.gnu.org; Tue, 24 Nov 2015 15:53:58 -0500 Received: by wmec201 with SMTP id c201so227937221wme.0 for <21985@debbugs.gnu.org>; Tue, 24 Nov 2015 12:53:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=MiALt825dIMOQ7FEcvyiqLgmbgGhsk0Y/cQ3swuhdho=; b=ZH2iiNc1qExF+pPuJsSa7ZPCEAeXJZ2HRSq6IlDWBOvpsxxBU+ql5CccOfQDGrzXMA Masw6tiHbWLCikugPeAVMjXYE8mL/XK3o4wCF2I1kvMrpxM20Yh8M3h7pWeqxKWAvi24 elCV7IaG3Bs2tBJZpHejdGvXCPu7CvwRg7Sf29Y1zNc5MueiIaoRGI6H6boqE8mCHT7k TnpBHvxx732KlcixNUKBw8t2yBSXaKFjj2lhyeRiOxhzhiYTf/Cq8UyLcBmvrf/1iFX8 Jd4Ew9D4G+t4EIBlIv/pXpuINA8E+1O7FuGbjPKkc8hwwpqJ0qalVtAl1xwZ9u/8UUAu N6qQ== X-Received: by 10.28.212.84 with SMTP id l81mr476046wmg.50.1448398437304; Tue, 24 Nov 2015 12:53:57 -0800 (PST) Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id 67sm350217wmm.6.2015.11.24.12.53.55 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Nov 2015 12:53:56 -0800 (PST) Subject: Re: bug#21985: 25.0.50; PATCH] Extend the test suite for json.el To: =?UTF-8?Q?Simen_Heggest=c3=b8yl?= References: <1448227819.17458.0@smtp.gmail.com> <56524C7B.9010500@yandex.ru> <1448396729.6004.1@smtp.gmail.com> From: Dmitry Gutov Message-ID: <5654CE62.3010207@yandex.ru> Date: Tue, 24 Nov 2015 22:53:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0 MIME-Version: 1.0 In-Reply-To: <1448396729.6004.1@smtp.gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21985 Cc: 21985@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 11/24/2015 10:25 PM, Simen Heggestøyl wrote: > I've attached an updated patch. Please go ahead, you obviously know what you're doing there. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 24 17:16:37 2015 Received: (at 21985-done) by debbugs.gnu.org; 24 Nov 2015 22:16:37 +0000 Received: from localhost ([127.0.0.1]:51780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a1Lt7-00033P-AT for submit@debbugs.gnu.org; Tue, 24 Nov 2015 17:16:37 -0500 Received: from mail-lf0-f46.google.com ([209.85.215.46]:35190) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a1Lt4-00033G-Rt for 21985-done@debbugs.gnu.org; Tue, 24 Nov 2015 17:16:35 -0500 Received: by lfdl133 with SMTP id l133so38908484lfd.2 for <21985-done@debbugs.gnu.org>; Tue, 24 Nov 2015 14:16:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:cc:message-id:in-reply-to:references :mime-version:content-type; bh=gfZ4xEOM5bvCUjgES4COHUEDPkJs0hSsicrbTs4Nzzo=; b=E+Zxk99Td9YbA5b/LRS0tL7jtqGxdTDIpP4galfs+yFu8SbBtqQyR/jcxDOdp9csOA AbEb8Qm6PqmmFdmFFqUYo9XWhVWqa4wKbadgV+z/znPRrR2Lud0vpEYnqzu6Ygh8aWqD O3OzkbaH0d6EUW7FI01Z7o+cDVgqkDVIjoXdsRveqzDNandlkxYIRTa8qKR0NFTRdHW4 kqKWnN7yjy77d3syfZ3gB/n8s1A8WSQTAJAE3ZGKvP42WnOzHe1Bu3qRVuPxZF47iARm H3SX3nOTnZ9pWnV5QCUS0mHcbsyoZdCOfT9Lslgy3SpnaEc6wDpeQcsj8esxYLMNvRjl KZyQ== X-Received: by 10.25.205.146 with SMTP id d140mr4277770lfg.17.1448403394056; Tue, 24 Nov 2015 14:16:34 -0800 (PST) Received: from [192.168.100.5] (cm-84.210.143.4.getinternet.no. [84.210.143.4]) by smtp.gmail.com with ESMTPSA id g3sm1925214lfd.25.2015.11.24.14.16.32 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Nov 2015 14:16:33 -0800 (PST) Date: Tue, 24 Nov 2015 23:16:31 +0100 From: Simen =?iso-8859-1?q?Heggest=F8yl?= Subject: Re: bug#21985: 25.0.50; PATCH] Extend the test suite for json.el To: Dmitry Gutov Message-Id: <1448403391.7373.0@smtp.gmail.com> In-Reply-To: <5654CE62.3010207@yandex.ru> References: <1448227819.17458.0@smtp.gmail.com> <56524C7B.9010500@yandex.ru> <1448396729.6004.1@smtp.gmail.com> <5654CE62.3010207@yandex.ru> X-Mailer: geary/0.10.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=-LdxpFsegPuPZvUNadhD1" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21985-done Cc: 21985-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-LdxpFsegPuPZvUNadhD1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On Tue, Nov 24, 2015 at 9:53 PM, Dmitry Gutov wrote: > On 11/24/2015 10:25 PM, Simen Heggest=C3=B8yl wrote: >=20 >> I've attached an updated patch. >=20 > Please go ahead, you obviously know what you're doing there. Thanks, installed. -- Simen = --=-LdxpFsegPuPZvUNadhD1 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tue, Nov 24, 2015 at 9:53 PM, Dmitry Gutov <dgutov@yandex.ru> wrot= e:
On 11/24/2015 10:25 PM, Simen Heggest=C3=B8yl wrote:
I've attached an updated patch.
Please go ahead, you obviously know what you're doing there.

Thanks, installed.

-- Simen
= --=-LdxpFsegPuPZvUNadhD1-- From unknown Sat Jun 21 03:06:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 23 Dec 2015 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator