From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cKszJKn9rmR+VwAASxT56A (envelope-from ) for ; Wed, 12 Jul 2023 21:23:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id eDkqJKn9rmTJQwEA9RJhRA (envelope-from ) for ; Wed, 12 Jul 2023 21:23:21 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 360E461B82 for ; Wed, 12 Jul 2023 21:23:21 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=bUaTX4xf; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1689189801; a=rsa-sha256; cv=none; b=pDAyJbycC/4JFNVIBkYLrqHVwqHQXgf2xgS77qgo321wmp5UHhUAF7hut+RdrPhVkqDgp+ VibxKfwTaJcvE0m8/inWyCnFQapYKNiYg36PIDczE2qIW3bju6vcQYV1opva5V4zeqbrNO qQAQxIAAAa35A49kCEcRizTFPPzxn10DVplic0aWyP7nkHhTCYQnCmidXqCwtYcnFKoph0 HolyVJrKVb527icKYw9rMN1xNIXPgKa+DdKxcL4gyD3Pm378Q5mCoRLD8dDnaBljE5saNO p36i9XsxKhONkBvdl/pB7Isx/YxwxjnO5RF6YMNx1b+2m0OBoUR1oSAG7DDqnA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=bUaTX4xf; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1689189801; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=6yv2qKFfv7/ZRVBfK9Eav1WgIFxrtZtZojV9Tqz+Y1U=; b=OV2C0z9JdGMFlv+L5VGaPbP3h+oZYiKve/yK9acb/YmGuD5Ozfc48K4AEB2MDC/SNUujyZ 0o2JcLMxaRxFffuRvfz3Nbd/s7EuWs7rh+ACU0fyRgHpVJEf2Z3FzfMGMGE5UqZ8NgyU6J 0VpkP/x/EvN6ukLX/akK7BUYSWLlj1clFn6pcGh5+JJ9FYZW1ub3C3C37j6g5M8k61AsUR palfwCVmPrPT7fgHst0SwDUsJGpB+dD089woUC/8pkrD/lKP7ASLYKysuKbG1EG6F3UYii wZCAyp3+NCsb4d2bYoWpA+z0/Fc6onNyLVEI3M/prHGtfM6yoEPQuTK5oFOqtA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJfPr-0008Q8-C4; Wed, 12 Jul 2023 15:22:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJfPp-0008Pu-Mz for emacs-orgmode@gnu.org; Wed, 12 Jul 2023 15:22:21 -0400 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJfPn-0005rr-NM for emacs-orgmode@gnu.org; Wed, 12 Jul 2023 15:22:21 -0400 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2b72161c6e9so14738451fa.0 for ; Wed, 12 Jul 2023 12:22:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689189736; x=1691781736; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=6yv2qKFfv7/ZRVBfK9Eav1WgIFxrtZtZojV9Tqz+Y1U=; b=bUaTX4xfM4xyBesE5RVPg06tERPrw1qtXuceMFlbQTjdVAaOhj6AzyPYIYVtJfmEyN 4wkvLwUBJsqM+GNZeF9JXireB9elxZ7/apJE6D8h/2LKf/lCUsQm/Qrl9Oc9yfQ4eDAh hPYEBJ7KQxgo7M+J6t/MO/Ns9+hec4dc+s8j/59o7gppW4uYpZzKpmMvQFpH+UQAX5gA arn0Bjm2G4aweJkDrRzUqwq17qXqLD/061YO5XjQWd/JAaWJNP1sfVBsxN0ywrhEL8CR xJe7hi2vZvWIdjRgIGmir6PZU2tJv+UVz5mDEuk+UWNI+VhcdTqJCJ9zDaIz5yG0zjib 5TFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689189736; x=1691781736; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6yv2qKFfv7/ZRVBfK9Eav1WgIFxrtZtZojV9Tqz+Y1U=; b=KW6+PEl/ia3xJplo2zyYbGzZxKPZweD08is3vTpZGyHNLPnPsBskAl5ZB5p029ON5t YdZKFIsjzw3HTeclJcaLVaZO/+aeXxZwwJeUyzP8YDlpKSEBSOA5MXVOpLikPAh2We1t hx0ausIQuMvSapUv7hNJqjR8lX+dkdBP+nWy2d55odTtYYH5X9Q5DZDo2F80B8lYRDwf 6TZMQotK+9kovysf/5qblKhnHSWSz46VI3E/t19E1iGyS7R+AXKfq2midjIu7SvnE97B F3cU7BJQW1APW1yapLTkjnO7J90y7ul8nDn7D0qx9X3FGeyxuMOUJBAGleLjoZbwxLwm 7ozQ== X-Gm-Message-State: ABy/qLYbJ7YN2Rl3ifxf4wYyl4RZpJ8s0N448NhxQhT+mxXgp5U2NM9X MutbjrBTdhRCSXLcZf4C1M0H75p2LRA= X-Google-Smtp-Source: APBJJlH3mIxiPzctf55c3uIgctMUzW1kv0+ftLOijZc3JJsvIrB3xprQlq9otnvIixydBv/HfDIOiA== X-Received: by 2002:a05:651c:84:b0:2b6:d0c1:7cd0 with SMTP id 4-20020a05651c008400b002b6d0c17cd0mr1083933ljq.22.1689189735719; Wed, 12 Jul 2023 12:22:15 -0700 (PDT) Received: from sonyvaio ([92.127.245.54]) by smtp.gmail.com with ESMTPSA id r12-20020a2e994c000000b002b6e863108esm1099002ljj.9.2023.07.12.12.22.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 12:22:15 -0700 (PDT) From: Ilya Chernyshov To: emacs-orgmode Subject: [PATCH] testing: Delete duplicate tests Date: Thu, 13 Jul 2023 02:22:09 +0700 Message-ID: <87cz0xndem.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=ichernyshovvv@gmail.com; helo=mail-lj1-x22e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -9.47 X-Spam-Score: -9.47 X-Migadu-Queue-Id: 360E461B82 X-TUID: RrvkPglouXNW --=-=-= Content-Type: text/plain Hello. In my last patch, I found a duplicate test, so I decided to find all of the duplicate tests inside testing/lisp/ folder via this function: (defun count-duplicate-tests (&optional directory) (let (files) (dolist (file (directory-files (or directory default-directory) t (rx ".el" string-end) t)) (with-current-buffer (find-file-noselect file) (save-excursion (goto-char (point-min)) (while (search-forward "(ert-deftest" nil t) (ignore-errors (while-let((form (or (read (current-buffer)) t))) (when (eq (car-safe form) 'should) (setf (alist-get form (alist-get file files nil nil #'equal) 0 nil #'equal) (1+ (alist-get form (alist-get file files nil nil #'equal) 0 nil #'equal)))))))))) (seq-remove (lambda(file) (null (cdr file))) (mapcar (lambda(file) (cons (car file) (seq-filter (lambda(form) (/= (cdr form) 1)) (cdr file)))) files)))) (setq dups (count-duplicate-tests "~/org-mode/testing/lisp/")) Then I checked the result manually and deleted some of them. Here is the patch I wrote: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-testing-Delete-duplicate-tests.patch >From 21ba128bd648c6737ed088abdd2a1824cfe01759 Mon Sep 17 00:00:00 2001 From: Ilya Chernyshov Date: Thu, 13 Jul 2023 01:36:33 +0700 Subject: [PATCH] testing: Delete duplicate tests * testing/lisp/test-ol.el (test-org-link/store-link): Delete a duplicate test. * testing/lisp/test-org-clock.el (test-org-clock/clocktable/properties): Delete a duplicate test. * testing/lisp/test-org-element.el (test-org-element/link-parser, test-org-element/timestamp-parser): Delete duplicate tests. * testing/lisp/test-org-table.el (test-org-table/get-field): Delete a duplicate test. * testing/lisp/test-org.el (test-org/auto-fill-function): Delete a duplicate test. --- testing/lisp/test-ol.el | 8 -------- testing/lisp/test-org-clock.el | 15 --------------- testing/lisp/test-org-element.el | 10 ---------- testing/lisp/test-org-table.el | 4 ---- testing/lisp/test-org.el | 8 -------- 5 files changed, 45 deletions(-) diff --git a/testing/lisp/test-ol.el b/testing/lisp/test-ol.el index a38d9f979..70be03818 100644 --- a/testing/lisp/test-ol.el +++ b/testing/lisp/test-ol.el @@ -301,14 +301,6 @@ See https://github.com/yantar92/org/issues/4." (let ((file (buffer-file-name))) (equal (format "[[file:%s::two]]" file file) (org-store-link nil)))))) - (should - (let ((org-stored-links nil) - (org-context-in-file-links t)) - (org-test-with-temp-text-in-file "# two" - (fundamental-mode) - (let ((file (buffer-file-name))) - (equal (format "[[file:%s::two]]" file file) - (org-store-link nil)))))) (should (let ((org-stored-links nil) (org-context-in-file-links t)) diff --git a/testing/lisp/test-org-clock.el b/testing/lisp/test-org-clock.el index d40939eb6..16cfc63a5 100644 --- a/testing/lisp/test-org-clock.el +++ b/testing/lisp/test-org-clock.el @@ -821,21 +821,6 @@ CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00 :PROPERTIES: :A: 1 :END: -CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00" - (test-org-clock-clocktable-contents ":properties (\"A\")")))) - ;; Handle missing properties. - (should - (equal - "| A | Headline | Time | -|---+--------------+---------| -| | *Total time* | *26:00* | -|---+--------------+---------| -| 1 | Foo | 26:00 |" - (org-test-with-temp-text - "* Foo -:PROPERTIES: -:A: 1 -:END: CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00" (test-org-clock-clocktable-contents ":properties (\"A\")"))))) diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el index 2e3a249ab..d95195f0d 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -2436,11 +2436,6 @@ e^{i\\pi}+1=0 (let ((file (expand-file-name (buffer-file-name)))) (insert (format "[[file:%s]]" file)) (equal (org-element-property :path (org-element-context)) file)))) - (should - (org-test-with-temp-text-in-file "" - (let ((file (expand-file-name (buffer-file-name)))) - (insert (format "[[file:%s]]" file)) - (equal (org-element-property :path (org-element-context)) file)))) ;; ... multi-line link. (should (equal "ls *.org" @@ -3195,11 +3190,6 @@ Outside list" (org-test-with-temp-text "<2023-07-02 Sun 12:00>--<2023-07-02 Sun 13:00>" (org-element-property :range-type (org-element-timestamp-parser))) 'daterange)) - (should - (eq - (org-test-with-temp-text "<2023-07-02 Sun 12:00>--<2023-07-02 Sun>" - (org-element-property :range-type (org-element-timestamp-parser))) - 'daterange)) (should (eq (org-test-with-temp-text "<2023-07-02 Sun 12:00 +5d>--<2023-07-02 Sun 13:00>" diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el index 27aeb5ab3..ce78d4488 100644 --- a/testing/lisp/test-org-table.el +++ b/testing/lisp/test-org-table.el @@ -3368,10 +3368,6 @@ See also `test-org-table/copy-field'." (org-test-with-temp-text "| 1 | 2 | 3 |" (org-table-get-field 3 " foo ") (buffer-string)))) - (should - (equal " 4 " - (org-test-with-temp-text "| 1 | 2 |\n| 3 | 4 |" - (org-table-get-field 2)))) ;; An empty REPLACE string clears the field. (should (equal "| |" diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 08cda543a..47dd9b876 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -994,14 +994,6 @@ (org-auto-fill-function) (buffer-string))))) ;; Comment block: auto fill contents. - (should - (equal "#+BEGIN_COMMENT\n12345\n7890\n#+END_COMMENT" - (org-test-with-temp-text "#+BEGIN_COMMENT\n12345 7890\n#+END_COMMENT" - (let ((fill-column 5)) - (forward-line) - (end-of-line) - (org-auto-fill-function) - (buffer-string))))) (should (equal "#+BEGIN_COMMENT\n12345\n7890\n#+END_COMMENT" (org-test-with-temp-text "#+BEGIN_COMMENT\n12345 7890\n#+END_COMMENT" -- 2.40.1 --=-=-=--