GNU bug report logs - #30745
26.0.91; ert should macros nest strangely

Previous Next

Package: emacs;

Reported by: phillip.lord <at> russet.org.uk (Phillip Lord)

Date: Wed, 7 Mar 2018 21:36:01 UTC

Severity: normal

Tags: patch

Found in version 26.0.91

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: phillip.lord <at> russet.org.uk (Phillip Lord)
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.91; ert should macros nest strangely
Date: Wed, 07 Mar 2018 21:34:22 +0000
ert should macros seem to behave strangely when nested.

Consider the following reproduction:

(require 'cl-lib)
(require 'ert)

(princ
 (cl-cdadr
  (ert-test-result-with-condition-condition
   (ert-run-test
    (make-ert-test
     :body
     (lambda () (should (eq 1 2))))))))

(princ "\nSecond test\n")

(princ
 (should
  (equal
   (cl-cdadr
    (ert-test-result-with-condition-condition
     (ert-run-test
      (make-ert-test
       :body
       (lambda () (should (eq 1 2)))))))
   '(:form (eq 1 2) :value nil))))

(princ "\n")

In Emacs-25 the following behaviour is seen when running this in batch.

~/src/git/emacs-git/emacs-25$ ./src/emacs --batch -l temp.el
(:form (eq 1 2) :value nil)
Second test
t


In Emacs-26, however, we get a different behaviour:


~/src/git/emacs-git/emacs-26$ ./phil_emacs.sh 
(:form (eq 1 2) :value nil)
Second test
Test failed: ((should (equal (cl-cdadr (ert-test-result-with-condition-condition (ert-run-test (make-ert-test :body (lambda nil (should (eq 1 2))))))) (quote (:form (eq 1 2) :value nil)))) :form (equal nil (:form (eq 1 2) :value nil)) :value nil :explanation (different-types nil (:form (eq 1 2) :value nil)))


So, although, the return type of this lot:

 (cl-cdadr
  (ert-test-result-with-condition-condition
   (ert-run-test
    (make-ert-test
     :body
     (lambda () (should (eq 1 2))))))))

remains the same between Emacs-25 and Emacs-26, a test for this breaks.

This regression is caused by:

commit 054c198c120c1f01a8ff753892d52710b740acc6

found by bisection. The regression continues on master.

I will try and find a simpler reproduction.




This bug report was last modified 3 years and 331 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.