From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#51941: Detect duplication of ERT tests Date: Thu, 18 Nov 2021 20:13:59 +0100 Message-ID: <977035C0-5706-419C-A7D8-88FC9F3B890F@acm.org> References: <21CD2DED-354E-4C46-9794-07172E3BD5F1@acm.org> <87fsrtkayn.fsf@gnus.org> <87mtm1z7dc.fsf@gnus.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3691"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51941@debbugs.gnu.org, Philipp To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 18 20:15:31 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mnmsc-0000iQ-Qt for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Nov 2021 20:15:30 +0100 Original-Received: from localhost ([::1]:53588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnmsb-0000Al-5y for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Nov 2021 14:15:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnmsA-0000Ad-VG for bug-gnu-emacs@gnu.org; Thu, 18 Nov 2021 14:15:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53893) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mnmsA-00058V-MO for bug-gnu-emacs@gnu.org; Thu, 18 Nov 2021 14:15:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mnmsA-0003ZL-Az for bug-gnu-emacs@gnu.org; Thu, 18 Nov 2021 14:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Nov 2021 19:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51941 X-GNU-PR-Package: emacs Original-Received: via spool by 51941-submit@debbugs.gnu.org id=B51941.163726285313624 (code B ref 51941); Thu, 18 Nov 2021 19:15:02 +0000 Original-Received: (at 51941) by debbugs.gnu.org; 18 Nov 2021 19:14:13 +0000 Original-Received: from localhost ([127.0.0.1]:37206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnmrN-0003Xg-0z for submit@debbugs.gnu.org; Thu, 18 Nov 2021 14:14:13 -0500 Original-Received: from mail1477c50.megamailservers.eu ([91.136.14.77]:48838 helo=mail118c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnmrJ-0003XN-Pc for 51941@debbugs.gnu.org; Thu, 18 Nov 2021 14:14:11 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1637262842; bh=xlExUBaseW0LI+5CFVLOlFEP/EiX9E2jSGc0iQKinI4=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=BoV+ukCIOY8xvHx9kkTYuBKigRFzjZqJfhVUmPaggkoSeDjbHecNbaY6+5ha7b3uJ TvyT30ku8LEcVOcZqic3c0a931TBVSq4yr/ObrtvtCZJZTZ873248Eeq7+xFWvDULr hmBYblgRiKICwQfkdKfZgOa9jFuZKzaBhUEtsqVo= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail118c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 1AIJDxuA021519; Thu, 18 Nov 2021 19:14:01 +0000 In-Reply-To: <87mtm1z7dc.fsf@gnus.org> X-Mailer: Apple Mail (2.3445.104.21) X-CTCH-RefID: str=0001.0A742F1C.6196A5FA.001D, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.4 cv=M80ulw8s c=1 sm=1 tr=0 ts=6196a5fa a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=OocQHUDgAAAA:8 a=5r9OlORDTczz2FU4E0YA:9 a=CjuIK1q_8ugA:10 a=xUZTl98r3Qw_uB5NK3jt:22 X-Origin-Country: SE X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:220346 Archived-At: 18 nov. 2021 kl. 18.44 skrev Lars Ingebrigtsen : > By the way, this reminds me of a different error I often make in ert > files -- I type "defun" instead of "ert-deftest". Would it be > productive to check whether a -tests.el file contains a defun that's > never called? It would certainly be good to detect such mistakes, but I'm not sure how = to go about finding them. I wrote a quick-and-dirty scanner that found = about 400 uncalled functions in the test tree of which 1 or 2, maybe, = should have been `ert-deftest` (will fix those right away). Clearly something with much better signal/noise ratio is called for. One = would be to only consider functions using `should` etc. > But perhaps it's such a marginal problem that it's not worth checking > for. It's unclear how frequent this mistake is but at least now we have = concrete evidence of its existence. On the other hand, it will be found = by a test author who has adopted the standard "test first without then = with the fix" ritual as habit. (I'm not accusing you of bad discipline; I'm probably no better myself, = and in any case berating people for being careless is not how to solve = problems caused by human mistakes.) I may or may not have the time to try to find something better so feel = free to take a shot if you like.