Subject: Re: bug#30745: 26.0.91; ert should macros nest strangely

From: [email-masked] (Phillip Lord)
Date: Wed, 07 Mar 2018 22:24:38 +0000

This reproduction with a simpler test shows that the problem is nesting.

(require 'ert)

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

(princ (simple-test))

(princ "\nAnd forcibly unnested\n")

(princ
 (let ((res (simple-test)))
   (should
    (equal
     '(ert-test-failed
       ((should (eq 1 2)) :form (eq 1 2) :value nil))
     res))))

(princ "\nAnd nested\n")

(princ
 (should
  (equal
   '(ert-test-failed
     ((should (eq 1 2)) :form (eq 1 2) :value nil))
   (simple-test))))

(princ "\n")

Emacs-25

(ert-test-failed ((should (eq 1 2)) :form (eq 1 2) :value nil))
And forcibly unnested
t
And nested
t

Emacs-26

(ert-test-failed ((should (eq 1 2)) :form (eq 1 2) :value nil))
And forcibly unnested
t
And nested
Test failed: ((should (equal (quote (ert-test-failed ((should (eq 1 2)) :form (eq 1 2) :value nil))) (simple-test))) :form (equal (ert-test-failed ((should (eq 1 2)) :form (eq 1 2) :value nil)) (((should (eq 1 2)) :form (eq 1 2) :value nil))) :value nil :explanation (proper-lists-of-different-length 2 1 (ert-test-failed ((should (eq 1 2)) :form (eq 1 2) :value nil)) (((should (eq 1 2)) :form (eq 1 2) :value nil)) first-mismatch-at 0))