From unknown Sat Jun 14 14:29:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49805: 28.0.50; ERT condition printing comes too late Resent-From: Philipp Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Aug 2021 12:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49805 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 49805@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162781937725172 (code B ref -1); Sun, 01 Aug 2021 12:03:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Aug 2021 12:02:57 +0000 Received: from localhost ([127.0.0.1]:35762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAABE-0006Xw-I3 for submit@debbugs.gnu.org; Sun, 01 Aug 2021 08:02:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:51384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAABA-0006Xm-Aj for submit@debbugs.gnu.org; Sun, 01 Aug 2021 08:02:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAABA-0000nq-37 for bug-gnu-emacs@gnu.org; Sun, 01 Aug 2021 08:02:52 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:34711) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mAAB8-0008OY-Bb for bug-gnu-emacs@gnu.org; Sun, 01 Aug 2021 08:02:51 -0400 Received: by mail-wm1-x332.google.com with SMTP id l4-20020a05600c1d04b02902506f89ad2dso10148668wms.1 for ; Sun, 01 Aug 2021 05:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=CljKGQG2UoISAFyEBz3mMEZRi8dYG8PGujuiwfrOFZA=; b=kFMwObrShA3w2hCy5PZy9j93CbvaN/y3BEvdA6JLdLmOtkbZmN2e5gJqMymyzpp+1e mME3Urel4enSejYL2m91B2YADHPPuJe+tVqC8HLYgF+T52jXhpvaWrBakiN13Y2b58VP EI9jxGLX2xymtEVdKOVyhXvtK4MEVYsdAlP7wfFYXdJeWs6dCOMew+9IoohL/wWPg/v5 w7Z4PquEOIuDjC11nbt5XjsDqpWvWpHziMrxaW10+v7RnHDZPaUNy5zv1dzGgHaLk7t0 vzSYVKfLmH+afCl+hYZdhcGCHtQZ93oOUMcF1bX+2Ait14QGJjqJF9LkjA1JvmsRJn4F VfDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=CljKGQG2UoISAFyEBz3mMEZRi8dYG8PGujuiwfrOFZA=; b=CAOrvjSiqFkh29xxby1vGFzS+AZYTtItA0CQqskGNNmaxi8zvH4E6Gxb2SsbqM8WLu zgoCfQXiOYVLeYmdBObboPPatxGYv2NoTjuG+OYsVrAASHKuLCYBDvB2U+NNKajREjvE /LmKzaGb3TFezv+IKzRmx5UJNjxv+x32daGGvudtf8puzzPEojYevCtzeZ49LGvtwWG8 CokyBL4X2XaY74PAvVp/xjxHMYhFRhL8U27Js+h+1ah2iirudb1m0QyqlqgnvM/H/IDR 6UPmceMXrMiFzFZmMuqvtYRj0dAakvnjGyP5PglOYtsdkUMBIWtuoJaJYYx8ij0piAUO OStg== X-Gm-Message-State: AOAM532FV0Vearc0QAC9pFMW1YWc85xYJEOVnuygMzuZlrMUFh8k0MWa BzTnDbaw9PJEGo3ljz2S7DVMt7srXXvilg== X-Google-Smtp-Source: ABdhPJxr/3VVj5hbcHjxJelUL5ooJMqRHiWIRU9EID2DN9FvuyZPerh0gx6TL4TaiQcz7X1OoLNFSQ== X-Received: by 2002:a05:600c:5117:: with SMTP id o23mr12248071wms.85.1627819367694; Sun, 01 Aug 2021 05:02:47 -0700 (PDT) Received: from Philipps-MBP.fritz.box ([46.128.198.100]) by smtp.gmail.com with ESMTPSA id l41sm7898750wmp.23.2021.08.01.05.02.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Aug 2021 05:02:47 -0700 (PDT) From: Philipp Date: Sun, 01 Aug 2021 14:02:46 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=p.stephani2@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -2.1 (--) $ emacs -Q -batch -l ert -eval '(ert-deftest f () (with-temp-buffer (insert= "foo") (should (equal (point-min-marker) (point-max-marker)))))' -f ert-ru= n-tests-batch-and-exit Running 1 tests (2021-08-01 13:59:16+0200, selector =E2=80=98t=E2=80=99) Test f backtrace: signal(ert-test-failed (((should (equal (point-min-marker) (point-ma ert-fail(((should (equal (point-min-marker) (point-max-marker))) :fo (if (unwind-protect (setq value-2 (apply fn-0 args-1)) (setq form-de (let (form-description-4) (if (unwind-protect (setq value-2 (apply f (let ((value-2 'ert-form-evaluation-aborted-3)) (let (form-descripti (let* ((fn-0 #'equal) (args-1 (condition-case err (let ((signal-hook (progn (insert "foo") (let* ((fn-0 #'equal) (args-1 (condition-case=20 (unwind-protect (progn (insert "foo") (let* ((fn-0 #'equal) (args-1=20 (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current (closure (t) nil (let ((temp-buffer (generate-new-buffer " *temp*" t ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test ert-run-test(#s(ert-test :name f :documentation nil :body (closure ( ert-run-or-rerun-test(#s(ert--stats :selector t :tests [#s(ert-test=20 ert-run-tests(t #f(compiled-function (event-type &rest event-args) # ert-run-tests-batch(nil) ert-run-tests-batch-and-exit() command-line-1(("-l" "ert" "-eval" "(ert-deftest f () (with-temp-buf command-line() normal-top-level() Test f condition: (ert-test-failed ((should (equal (point-min-marker) (point-max-marker))) :form (equal # #) :value nil :explanation (different-atoms # #))) FAILED 1/1 f (0.000374 sec) Ran 1 tests, 0 results as expected, 1 unexpected (2021-08-01 13:59:17+0200,= 0.856999 sec) 1 unexpected results: FAILED f Note the 'marker in no buffer' representation for the markers. This behavior is understandable (the condition is printed after the temporary buffer is gone), but makes debugging test failures a bit harder (what was the actual marker, and why is it different?). Similar things happen for buffers that are killed before printing the test results. It would be great to print the condition (and backtrace?) into a string right when the assertion fails, to improve the debugging output in such cases. In GNU Emacs 28.0.50 (build 20, aarch64-apple-darwin20.6.0, NS appkit-2022.= 60 Version 11.5.1 (Build 20G80)) of 2021-08-01 Repository revision: 12af7ee46d47152a2c499e24970a6ab4a94aed61 Repository branch: master Windowing system distributor 'Apple', version 10.3.2022 System Description: macOS 11.5.1 Configured using: 'configure --with-modules --without-xml2 --without-pop --with-mailutils --enable-gcc-warnings=3Dwarn-only --enable-checking=3Dall --enable-check-lisp-object-type 'CFLAGS=3D-ggdb3 -O0'' Configured features: ACL GNUTLS JSON LCMS2 MODULES NOTIFY KQUEUE NS PDUMPER PNG THREADS TOOLKIT_SCROLL_BARS ZLIB Important settings: value of $LANG: de_DE.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc dired dired-loaddefs rfc822 mml mml-sec epa epg epg-config gnus-util rmail rmail-loaddefs time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils phst skeleton derived edmacro kmacro pcase ffap thingatpt url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars mailcap rx gnutls puny dbus xml subr-x seq byte-opt gv bytecomp byte-compile cconv compile text-property-search comint ansi-color ring cl-loaddefs cl-lib iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 70384 4979) (symbols 48 8504 1) (strings 32 24020 1276) (string-bytes 1 783486) (vectors 16 16301) (vector-slots 8 208282 12573) (floats 8 26 26) (intervals 56 219 0) (buffers 992 10))