all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ilya Chernyshov <ichernyshovvv@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] testing: Delete duplicate tests
Date: Sat, 27 Jan 2024 11:04:45 +0600	[thread overview]
Message-ID: <874jeznz82.fsf@gmail.com> (raw)
In-Reply-To: <871qa4fcs5.fsf@localhost>

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

Ihor Radchenko <yantar92@posteo.net> writes:

> What about the attached amendment?
> It should simplify things significantly.

Sorry, in my previous patch the test that checks the detector itself was not
even run in 'make test' because of incorrect test prefix.

Your patch does not work as you expect. Could you please revise it?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-test-duplicates-detector.el-Add-correct-prefix-to-th.patch --]
[-- Type: text/x-patch, Size: 2405 bytes --]

From 6eb03414ac4eb8b64160b24dc7fcb805bf782310 Mon Sep 17 00:00:00 2001
From: Ihor Radchenko <yantar92@posteo.net>
Date: Fri, 26 Jan 2024 14:21:55 +0100
Subject: [PATCH] test-duplicates-detector.el: Add correct prefix to the
 deftest, check if consp

*
testing/lisp/test-duplicates-detector.el (test-duplicates-detector--search-forms-recursively):

*
testing/lisp/test-duplicates-detector.el (test-org-tests/test-duplicates-detector-testing-find-duplicates):
Add correct prefix so that the test could be executed
---
 testing/lisp/test-duplicates-detector.el | 25 ++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/testing/lisp/test-duplicates-detector.el b/testing/lisp/test-duplicates-detector.el
index d6f8aca5a..aed8034ee 100644
--- a/testing/lisp/test-duplicates-detector.el
+++ b/testing/lisp/test-duplicates-detector.el
@@ -231,22 +231,23 @@ FORM-PATH is list of the form:
 Write each form to `test-duplicates-detector-forms'"
   (let ((idx 0))
     (dolist (sub-form form)
-      (unless (memq (car-safe sub-form) test-duplicates-progn-forms)
-        (push idx (alist-get
-		   sub-form
-                   (alist-get form-path test-duplicates-detector-forms
-                              nil nil #'equal)
-                   nil nil #'equal-including-properties)))
-      (unless (memq (car-safe sub-form)
-		    '(should-not should should-error))
-	(test-duplicates-detector--search-forms-recursively
-         sub-form
-         (append form-path (list (cons (car sub-form) idx)))))
+      (when (consp sub-form)
+        (unless (memq (car-safe sub-form) test-duplicates-progn-forms)
+          (push idx (alist-get
+		     sub-form
+                     (alist-get form-path test-duplicates-detector-forms
+                                nil nil #'equal)
+                     nil nil #'equal-including-properties)))
+        (unless (memq (car-safe sub-form)
+		      '(should-not should should-error))
+	  (test-duplicates-detector--search-forms-recursively
+           sub-form
+           (append form-path (list (cons (car-safe sub-form) idx))))))
       (cl-incf idx))))
 
 ;;;; Testing the detector itself
 
-(ert-deftest test-duplicates-detector-testing-find-duplicates ()
+(ert-deftest test-org-tests/test-duplicates-detector-testing-find-duplicates ()
   "Test `test-duplicates-detector--find-duplicates'."
   (should
    (equal
-- 
2.41.0


  reply	other threads:[~2024-01-27  5:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 19:22 [PATCH] testing: Delete duplicate tests Ilya Chernyshov
2023-07-13  9:51 ` Ihor Radchenko
2023-08-08 12:44   ` Ihor Radchenko
2023-08-31  6:17     ` Ilya Chernyshov
2023-08-31  6:29       ` Ihor Radchenko
2023-11-08  9:59         ` Ihor Radchenko
2023-11-11  8:55           ` Ilya Chernyshov
2023-11-16 12:27             ` Ilya Chernyshov
2024-01-16 13:44             ` Ihor Radchenko
2024-01-23 12:03               ` Ilya Chernyshov
2024-01-26 13:24                 ` Ihor Radchenko
2024-01-27  5:04                   ` Ilya Chernyshov [this message]
2024-01-31 12:17                     ` Ihor Radchenko
2024-02-09 12:22                       ` Ilya Chernyshov
2024-02-09 14:11                         ` Ihor Radchenko
2023-07-14 11:50 ` Max Nikulin
2023-07-15  7:56   ` Ihor Radchenko

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=874jeznz82.fsf@gmail.com \
    --to=ichernyshovvv@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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.