Subject: Re: bug#21701: Fwd: cl-typecase broken (was 25.0.50; ert explainer for equal can't handle negative numbers)

From: Anders Lindgren <[email-masked]>
Date: Sat, 5 Dec 2015 16:08:23 +0100

Hi,

Two of the problems can be fixed with the attached patch.

The third, `ert-test-record-backtrace' in `ert-tests.el' seems to compare
backtrace output -- I haven't looked it as I have no idea what it is
supposed to test.

    -- Anders

On Fri, Dec 4, 2015 at 11:58 PM, Glenn Morris <[email-masked]> wrote:

> Stefan Monnier wrote:
>
> > I installed a patch which makes ERT use pcase over cl-typecase.
>
> This causes test failures.
>
> http://hydra.nixos.org/build/28477383
> http://hydra.nixos.org/build/28477383/log/raw
>
>
>    FAILED  ert-test-equal-including-properties
>    FAILED  ert-test-explain-equal
>    FAILED  ert-test-explain-equal-improper-list
>    FAILED  ert-test-explain-equal-string-properties
>    FAILED  ert-test-plist-difference-explanation
>    FAILED  ert-test-run-tests-interactively
>    FAILED  ert-test-run-tests-interactively-2
>
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index a75b23b..02ae41b 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -515,7 +515,7 @@ ert--explain-equal-rec
                   for xi = (ert--explain-equal-rec ai bi)
                   do (when xi (cl-return `(array-elt ,i ,xi)))
                   finally (cl-assert (equal a b) t))))
-      ((pred atomp)
+      ((pred atom)
        (if (not (equal a b))
            (if (and (symbolp a) (symbolp b) (string= a b))
                `(different-symbols-with-the-same-name ,a ,b)
@@ -1071,7 +1071,7 @@ ert--insert-human-readable-selector
                      (make-symbol "<unnamed test>")))
                   (`(,operator . ,operands)
                    (pcase operator
-                     ((or 'eql 'and 'not 'or)
+                     ((or 'member 'eql 'and 'not 'or)
                       `(,operator ,@(mapcar #'rec operands)))
                      ((or 'tag 'satisfies)
                       selector))))))