bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#51037: [PATCH] Make `print-level` & `print-length` customizable in E


From: Filipp Gunbin
Subject: bug#51037: [PATCH] Make `print-level` & `print-length` customizable in ERT batch tests
Date: Wed, 17 Nov 2021 19:22:08 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)

On 16/11/2021 08:48 +0100, Lars Ingebrigtsen wrote:

> Michael <sp1ff@runbox.com> writes:
>
>> New patch attached. Incorporates (I hope) these changes, as well
>> as addresses Eli's issues.
>
> Thanks; applied to Emacs 29 with some minor changes.
>
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

I've got this fixup patch for this, below.

Mainly this fixes `ert' interactive spec, where there was a leftover
second argument, nil.

However I'm not quite sure in this docstring fix:

-mode.  A value of nil will short-circuit this mechanism; line
-lengths will be completely determined by `ert-batch-line-length'
-and `ert-batch-line-level'.  Any other value will be temporarily

The docstring for backtrace-line-length says: "If set to nil or zero,
backtrace mode will not abbreviate the forms it prints."  So the above
sentence, which I removed, was indeed not true?  (a quick look over
its usages confirmed that to me, but I'd like someone else to check)

Thanks.


diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 36b4408dc8..7f9b7b22c7 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -101,12 +101,10 @@ ert-batch-backtrace-line-length
 forming them.  This variable governs the target maximum line
 length by manipulating these two variables while printing stack
 traces.  Setting this variable to t will re-use the value of
-`backtrace-line-length' while print stack traces in ERT batch
-mode.  A value of nil will short-circuit this mechanism; line
-lengths will be completely determined by `ert-batch-line-length'
-and `ert-batch-line-level'.  Any other value will be temporarily
-bound to `backtrace-line-length' when producing stack traces
-in batch mode.")
+`backtrace-line-length' while printing stack traces in ERT batch
+mode.  Any other value will be temporarily bound to
+`backtrace-line-length' when producing stack traces in batch
+mode.")
 
 (defface ert-test-result-expected '((((class color) (background light))
                                      :background "green1")
@@ -1447,8 +1445,6 @@ ert-run-tests-batch
                         (cond
                          ((eq ert-batch-backtrace-line-length t)
                           backtrace-line-length)
-                         ((eq ert-batch-backtrace-line-length nil)
-                          nil)
                          (t
                           ert-batch-backtrace-line-length)))
                        (print-level ert-batch-print-level)
@@ -2055,8 +2051,7 @@ ert-run-tests-interactively
            (read
             (completing-read (format-prompt "Run tests" default)
                              obarray #'ert-test-boundp nil nil
-                             'ert--selector-history default nil)))
-         nil))
+                             'ert--selector-history default nil)))))
   (let (buffer listener)
     (setq listener
           (lambda (event-type &rest event-args)





reply via email to

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