emacs-diffs
[Top][All Lists]
Advanced

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

master 1aacdf5 2/2: Distinguish errors in bytecomp-tests


From: Mattias Engdegård
Subject: master 1aacdf5 2/2: Distinguish errors in bytecomp-tests
Date: Wed, 19 Aug 2020 08:04:22 -0400 (EDT)

branch: master
commit 1aacdf5aab09c7d0f7de648e55df7305ac1b87eb
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Distinguish errors in bytecomp-tests
    
    * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-check-1)
    (test-byte-opt-arithmetic, bytecomp-lexbind-check-1)
    (bytecomp-lexbind-explain-1):
    When comparing interpreted with compiled results, don't consider all
    errors to be equal; take the error type into account.  (The error
    arguments may differ, but there may be good reasons for that.)
---
 test/lisp/emacs-lisp/bytecomp-tests.el | 42 +++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el 
b/test/lisp/emacs-lisp/bytecomp-tests.el
index 27acdff..f624273 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -365,24 +365,24 @@ bytecompiled code, and their results compared.")
 (defun bytecomp-check-1 (pat)
   "Return non-nil if PAT is the same whether directly evalled or compiled."
   (let ((warning-minimum-log-level :emergency)
-       (byte-compile-warnings nil)
-       (v0 (condition-case nil
+        (byte-compile-warnings nil)
+       (v0 (condition-case err
                (eval pat)
-             (error 'bytecomp-check-error)))
-       (v1 (condition-case nil
+             (error (list 'bytecomp-check-error (car err)))))
+       (v1 (condition-case err
                (funcall (byte-compile (list 'lambda nil pat)))
-             (error 'bytecomp-check-error))))
+             (error (list 'bytecomp-check-error (car err))))))
     (equal v0 v1)))
 
 (put 'bytecomp-check-1 'ert-explainer 'bytecomp-explain-1)
 
 (defun bytecomp-explain-1 (pat)
-  (let ((v0 (condition-case nil
+  (let ((v0 (condition-case err
                (eval pat)
-             (error 'bytecomp-check-error)))
-       (v1 (condition-case nil
+             (error (list 'bytecomp-check-error (car err)))))
+       (v1 (condition-case err
                (funcall (byte-compile (list 'lambda nil pat)))
-             (error 'bytecomp-check-error))))
+             (error (list 'bytecomp-check-error (car err))))))
     (format "Expression `%s' gives `%s' if directly evalled, `%s' if compiled."
            pat v0 v1)))
 
@@ -405,12 +405,12 @@ Subtests signal errors if something goes wrong."
        (print-quoted t)
        v0 v1)
     (dolist (pat byte-opt-testsuite-arith-data)
-      (condition-case nil
+      (condition-case err
          (setq v0 (eval pat))
-       (error (setq v0 'bytecomp-check-error)))
-      (condition-case nil
+       (error (setq v0 (list 'bytecomp-check-error (car err)))))
+      (condition-case err
          (setq v1 (funcall (byte-compile (list 'lambda nil pat))))
-       (error (setq v1 'bytecomp-check-error)))
+       (error (setq v1 (list 'bytecomp-check-error (car err)))))
       (insert (format "%s" pat))
       (indent-to-column 65)
       (if (equal v0 v1)
@@ -566,25 +566,25 @@ bytecompiled code, and their results compared.")
   "Return non-nil if PAT is the same whether directly evalled or compiled."
   (let ((warning-minimum-log-level :emergency)
        (byte-compile-warnings nil)
-       (v0 (condition-case nil
+       (v0 (condition-case err
                (eval pat t)
-             (error 'bytecomp-check-error)))
-       (v1 (condition-case nil
+             (error (list 'bytecomp-check-error (car err)))))
+       (v1 (condition-case err
                (funcall (let ((lexical-binding t))
                            (byte-compile `(lambda nil ,pat))))
-             (error 'bytecomp-check-error))))
+             (error (list 'bytecomp-check-error (car err))))))
     (equal v0 v1)))
 
 (put 'bytecomp-lexbind-check-1 'ert-explainer 'bytecomp-lexbind-explain-1)
 
 (defun bytecomp-lexbind-explain-1 (pat)
-  (let ((v0 (condition-case nil
+  (let ((v0 (condition-case err
                (eval pat t)
-             (error 'bytecomp-check-error)))
-       (v1 (condition-case nil
+             (error (list 'bytecomp-check-error (car err)))))
+       (v1 (condition-case err
                (funcall (let ((lexical-binding t))
                            (byte-compile (list 'lambda nil pat))))
-             (error 'bytecomp-check-error))))
+             (error (list 'bytecomp-check-error (car err))))))
     (format "Expression `%s' gives `%s' if directly evalled, `%s' if compiled."
            pat v0 v1)))
 



reply via email to

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