all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gemini Lasswell <gazally@runbox.com>
To: npostavs@users.sourceforge.net
Cc: 24402@debbugs.gnu.org, Alex <agrambot@gmail.com>,
	Tino Calancha <tino.calancha@gmail.com>
Subject: bug#24402: should-error doesn't catch all errors
Date: Thu, 20 Jul 2017 12:23:25 -0700	[thread overview]
Message-ID: <87bmoehpzm.fsf@runbox.com> (raw)
In-Reply-To: <87y3rk9gfa.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Wed, 19 Jul 2017 19:04:57 -0400")

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

npostavs@users.sourceforge.net writes:

> The following appears to fix it, though perhaps we should use a smarter
> equal function that would consider the circular lists to actually be
> equal instead of bailing out and returning nil on circularity.

Thanks for tracking this one down and making a patch, which looks good
to me. Does that smarter equal function already exist? It doesn't seem
worth the effort of writing one for this purpose only.

Here is a test to add to your patch, which fails without it and passes
with it:


[-- Attachment #2: 0001-Add-a-test-of-handling-of-circular-values-to-testcov.patch --]
[-- Type: text/plain, Size: 1206 bytes --]

From f401e3169ff3887b8215b6625d111d70e5340efe Mon Sep 17 00:00:00 2001
From: Gemini Lasswell <gazally@runbox.com>
Date: Thu, 20 Jul 2017 12:01:42 -0700
Subject: [PATCH] Add a test of handling of circular values to testcover-tests

* test/lisp/emacs-lisp-testcover-resources/testcases.el
(testcover-testcase-cyc1): New function.
(testcover-tests-circular-lists-bug-24402): New test.
---
 test/lisp/emacs-lisp/testcover-resources/testcases.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/lisp/emacs-lisp/testcover-resources/testcases.el b/test/lisp/emacs-lisp/testcover-resources/testcases.el
index 1eb791a993..c9a5a6daac 100644
--- a/test/lisp/emacs-lisp/testcover-resources/testcases.el
+++ b/test/lisp/emacs-lisp/testcover-resources/testcases.el
@@ -490,4 +490,14 @@ testcover-testcase-how-do-i-know-you
 
 (should (eq (testcover-testcase-how-do-i-know-you "Liz") 'unknown))
 
+;; ==== circular-lists-bug-24402 ====
+"Testcover captures and ignores circular list errors."
+;; ====
+(defun testcover-testcase-cyc1 (a)
+  (let ((ls (make-list 10 a%%%)))
+    (nconc ls ls)
+    ls))
+(testcover-testcase-cyc1 1)
+(testcover-testcase-cyc1 1)
+
 ;; testcases.el ends here.
-- 
2.12.2


  parent reply	other threads:[~2017-07-20 19:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-10  1:26 bug#24402: 25.1.50; testcover-start breaks should-error Gemini Lasswell
     [not found] ` <handler.24402.B.14734739098199.ack@debbugs.gnu.org>
2016-09-20  4:27   ` bug#24402: More Information Gemini Lasswell
2017-07-04  3:28     ` bug#24402: should-error doesn't catch all errors (Was:bug#24402: More Information) Alex
2017-07-05  0:00       ` bug#24402: should-error doesn't catch all errors Alex
2017-07-05 13:43         ` Tino Calancha
2017-07-05 19:56           ` Alex
2017-07-07 10:15             ` Tino Calancha
2017-07-09  7:04               ` Alex
2017-07-11 12:18             ` npostavs
2017-07-12  3:47               ` Alex
2017-07-12 12:30                 ` npostavs
2017-07-12 16:45                   ` Alex
2017-07-13  1:31                     ` npostavs
2017-07-13  3:04                       ` Alex
2017-07-13  3:44                         ` npostavs
2017-07-13 22:45                           ` Alex
2017-07-13 23:49                             ` npostavs
2017-07-14  4:42                               ` Alex
2017-07-14  4:45                                 ` Alex
2017-07-15 21:57                                 ` npostavs
2017-07-16  3:49                                   ` Alex
2017-07-17  0:46                                     ` npostavs
2017-07-19 21:23                                     ` Gemini Lasswell
2017-07-19 22:40                                       ` Alex
2017-07-19 23:04                                       ` npostavs
2017-07-20  4:04                                         ` Alex
2017-07-20 19:23                                         ` Gemini Lasswell [this message]
2017-08-08  1:15                                           ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bmoehpzm.fsf@runbox.com \
    --to=gazally@runbox.com \
    --cc=24402@debbugs.gnu.org \
    --cc=agrambot@gmail.com \
    --cc=npostavs@users.sourceforge.net \
    --cc=tino.calancha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.