emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Ilya Chernyshov <ichernyshovvv@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] testing: Delete duplicate tests
Date: Fri, 26 Jan 2024 13:24:26 +0000	[thread overview]
Message-ID: <871qa4fcs5.fsf@localhost> (raw)
In-Reply-To: <87il3kw91t.fsf@gmail.com>

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

Ilya Chernyshov <ichernyshovvv@gmail.com> writes:

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> It has been a while since the last update in this thread.
>> Ilya, do you need any help with the patch?
>
> Hi, here is the updated patch.

Thanks!

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-test-duplicates-detector.el-Do-not-search-duplicates.patch --]
[-- Type: text/x-patch, Size: 38166 bytes --]

From b14840aa81784547a6dd03aec510e23c898d97ec Mon Sep 17 00:00:00 2001
Message-ID: <b14840aa81784547a6dd03aec510e23c898d97ec.1706275424.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Fri, 26 Jan 2024 14:21:55 +0100
Subject: [PATCH] test-duplicates-detector.el: Do not search duplicates inside
 progn-like forms

*
testing/lisp/test-duplicates-detector.el (test-duplicates-progn-forms):
New variable holding a list of forms equivalent to `progn'.

*
testing/lisp/test-duplicates-detector.el (test-duplicates-detector--search-forms-recursively):
Refactor.  Skip duplicate checks inside immediate children of
`progn'-like constructs.

* testing/lisp/test-ob-R.el (test-ob-R/results-file):
* testing/lisp/test-ob-haskell-ghci.el (ob-haskell/session-named-none-means-one-shot-sessions):
* testing/lisp/test-ob-lob.el (test-ob-lob/call-with-header-arguments):
(test-ob-lob/caching-call-line):
(test-ob-lob/named-caching-call-line):
* testing/lisp/test-ob.el (test-ob/inline-src_blk-default-results-replace-line-1):
(test-ob/inline-src_blk-default-results-replace-line-2):
(test-ob/inline-src_blk-manual-results-replace):
(test-ob/inline-src_blk-results-silent):
(test-ob/just-one-results-block):
(test-ob/remove-inline-result):
(test-ob/goto-named-src-block):
* testing/lisp/test-ol.el (test-org-link/toggle-link-display):
* testing/lisp/test-org-agenda.el (test-org-agenda/property-timestamp):
(test-org-agenda/sticky-agenda-filter-preset):
* testing/lisp/test-org-element.el:
(test-org-element/cache-headline):
* testing/lisp/test-org-fold.el:
(test-org-fold/set-visibility-according-to-property):
* testing/lisp/test-org-list.el:
(test-org-list/list-navigation):
(test-org-list/move-item-down):
(test-org-list/move-item-up):
* testing/lisp/test-org-src.el:
(test-org-src/point-outside-block):
* testing/lisp/test-org-table.el:
(test-org-table/org-at-TBLFM-p):
(test-org-table/org-table-TBLFM-begin):
(test-org-table/org-table-TBLFM-begin-for-multiple-TBLFM-lines):
(test-org-table/org-table-TBLFM-begin-for-pultiple-TBLFM-lines-blocks):
* testing/lisp/test-org.el:
(test-org/goto-sibling):
(test-org/org-ctrl-c-ctrl-c):
(test-org/forward-element):
(test-org/backward-element):
(test-org/up-element): Remove unnecessary `org-test-ignore-duplicate'.
---
 testing/lisp/test-duplicates-detector.el |  34 ++++---
 testing/lisp/test-ob-R.el                |  21 ++--
 testing/lisp/test-ob-haskell-ghci.el     |   3 +-
 testing/lisp/test-ob-lob.el              |  87 ++++++++---------
 testing/lisp/test-ob.el                  | 117 ++++++++++-------------
 testing/lisp/test-ol.el                  |  35 ++++---
 testing/lisp/test-org-agenda.el          |   9 +-
 testing/lisp/test-org-element.el         |  18 ++--
 testing/lisp/test-org-fold.el            |  29 +++---
 testing/lisp/test-org-list.el            |  31 +++---
 testing/lisp/test-org-src.el             |   3 +-
 testing/lisp/test-org-table.el           |  93 +++++++++---------
 testing/lisp/test-org.el                 |  27 ++----
 13 files changed, 232 insertions(+), 275 deletions(-)

diff --git a/testing/lisp/test-duplicates-detector.el b/testing/lisp/test-duplicates-detector.el
index d39092a9e..d6f8aca5a 100644
--- a/testing/lisp/test-duplicates-detector.el
+++ b/testing/lisp/test-duplicates-detector.el
@@ -41,6 +41,14 @@ (require 'org-test "../testing/org-test")
 
 ;;;; Variables
 
+(defvar test-duplicates-progn-forms
+  '( progn
+     org-test-with-temp-text
+     org-test-with-temp-text-in-file
+     org-test-ignore-duplicate)
+  "List of forms equivalent to `progn'.
+Immediate children inside these are not checked for duplicates.")
+
 (defvar test-duplicates-detector-file-path
   (expand-file-name "test-duplicates-detector.el"
                     (expand-file-name "lisp" org-test-dir)))
@@ -221,22 +229,20 @@ (defun test-duplicates-detector--search-forms-recursively (form form-path)
     (symbol-1 . sexp-order-1) (symbol-2 . sexp-order-2))
 
 Write each form to `test-duplicates-detector-forms'"
-  (dotimes (iter (length form))
-    (when (and
-	   (car-safe (nth iter form))
-	   (not
-	    (eq (car-safe (nth iter form))
-		'org-test-ignore-duplicate)))
-      (push iter (alist-get
-		  (nth iter form)
-                  (alist-get form-path test-duplicates-detector-forms
-                             nil nil #'equal)
-                  nil nil #'equal-including-properties))
-      (unless (memq (car-safe (nth iter form))
+  (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
-         (nth iter form)
-         (append form-path (list (cons (car (nth iter form)) iter))))))))
+         sub-form
+         (append form-path (list (cons (car sub-form) idx)))))
+      (cl-incf idx))))
 
 ;;;; Testing the detector itself
 
diff --git a/testing/lisp/test-ob-R.el b/testing/lisp/test-ob-R.el
index 52e093edd..47211a1a9 100644
--- a/testing/lisp/test-ob-R.el
+++ b/testing/lisp/test-ob-R.el
@@ -96,17 +96,16 @@ (ert-deftest test-ob-R/results-file ()
   a <- file.path(\"junk\", \"test.org\")
   a
 #+END_SRC"
-     (goto-char (point-min)) (org-babel-execute-maybe)
-     (org-babel-goto-named-result "TESTSRC") (forward-line 1)
-     (org-test-ignore-duplicate
-       (should (string= "[[file:junk/test.org]]"
-		        (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
-     (goto-char (point-min)) (forward-line 1)
-     (insert "#+header: :session\n")
-     (goto-char (point-min)) (org-babel-execute-maybe)
-     (org-babel-goto-named-result "TESTSRC") (forward-line 1)
-     (should (string= "[[file:junk/test.org]]"
-		      (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))))
+      (goto-char (point-min)) (org-babel-execute-maybe)
+      (org-babel-goto-named-result "TESTSRC") (forward-line 1)
+      (should (string= "[[file:junk/test.org]]"
+		       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
+      (goto-char (point-min)) (forward-line 1)
+      (insert "#+header: :session\n")
+      (goto-char (point-min)) (org-babel-execute-maybe)
+      (org-babel-goto-named-result "TESTSRC") (forward-line 1)
+      (should (string= "[[file:junk/test.org]]"
+		       (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))))
 
 
 
diff --git a/testing/lisp/test-ob-haskell-ghci.el b/testing/lisp/test-ob-haskell-ghci.el
index 55c0eb2b8..cbd5f6f9a 100644
--- a/testing/lisp/test-ob-haskell-ghci.el
+++ b/testing/lisp/test-ob-haskell-ghci.el
@@ -118,8 +118,7 @@ (ert-deftest ob-haskell/session-named-none-means-one-shot-sessions ()
   "When no session, use a new session.
 \"none\" is a special name that means `no session'."
   (test-ob-haskell-ghci ":session none" "x=2" nil)
-  (org-test-ignore-duplicate
-    (should-not (equal 2 (test-ob-haskell-ghci ":session \"none\"" "x" nil))))
+  (should-not (equal 2 (test-ob-haskell-ghci ":session \"none\"" "x" nil)))
   (test-ob-haskell-ghci ":session none" "x=2" nil)
   (should-not (equal 2 (test-ob-haskell-ghci ":session \"none\"" "x" nil))))
 
diff --git a/testing/lisp/test-ob-lob.el b/testing/lisp/test-ob-lob.el
index 1a3fdff16..4d159fdb0 100644
--- a/testing/lisp/test-ob-lob.el
+++ b/testing/lisp/test-ob-lob.el
@@ -62,45 +62,44 @@ (ert-deftest test-ob-lob/call-with-header-arguments ()
 	(move-beginning-of-line 1)
 	(forward-line 6)
 	(message (buffer-substring (point-at-bol) (point-at-eol)))
-	(org-test-ignore-duplicate
-          (should
-	   (string= "testing" (org-babel-execute-src-block
-			       nil (org-babel-lob-get-info))))
-	  (forward-line 1)
-	  (should
-	   (string= "testing" (caar (org-babel-execute-src-block
-				     nil (org-babel-lob-get-info)))))
-	  (forward-line 1)
-	  (should
-	   (string= "testing" (org-babel-execute-src-block
-			       nil (org-babel-lob-get-info))))
-	  (forward-line 1)
-	  (should
-	   (string= "testing" (caar (org-babel-execute-src-block
-				     nil (org-babel-lob-get-info)))))
-	  (forward-line 1)
-	  (should
-	   (string= "testing" (org-babel-execute-src-block
-			       nil (org-babel-lob-get-info))))
-	  (forward-line 1)
-	  (should
-	   (string= "testing" (caar (org-babel-execute-src-block
-				     nil (org-babel-lob-get-info)))))
-	  (forward-line 1) (beginning-of-line) (forward-char 27)
-	  (should
-	   (string= "testing" (org-babel-execute-src-block
-			       nil (org-babel-lob-get-info))))
-	  (forward-line 1) (beginning-of-line) (forward-char 27)
-	  (should
-	   (string= "testing" (caar (org-babel-execute-src-block
-				     nil (org-babel-lob-get-info)))))
-	  (forward-line 1) (beginning-of-line)
-	  (should
-	   (= 4 (org-babel-execute-src-block nil (org-babel-lob-get-info))))
-	  (forward-line 1)
-	  (should
-	   (string= "testing" (org-babel-execute-src-block
-			       nil (org-babel-lob-get-info)))))
+        (should
+	 (string= "testing" (org-babel-execute-src-block
+			     nil (org-babel-lob-get-info))))
+	(forward-line 1)
+	(should
+	 (string= "testing" (caar (org-babel-execute-src-block
+				   nil (org-babel-lob-get-info)))))
+	(forward-line 1)
+	(should
+	 (string= "testing" (org-babel-execute-src-block
+			     nil (org-babel-lob-get-info))))
+	(forward-line 1)
+	(should
+	 (string= "testing" (caar (org-babel-execute-src-block
+				   nil (org-babel-lob-get-info)))))
+	(forward-line 1)
+	(should
+	 (string= "testing" (org-babel-execute-src-block
+			     nil (org-babel-lob-get-info))))
+	(forward-line 1)
+	(should
+	 (string= "testing" (caar (org-babel-execute-src-block
+				   nil (org-babel-lob-get-info)))))
+	(forward-line 1) (beginning-of-line) (forward-char 27)
+	(should
+	 (string= "testing" (org-babel-execute-src-block
+			     nil (org-babel-lob-get-info))))
+	(forward-line 1) (beginning-of-line) (forward-char 27)
+	(should
+	 (string= "testing" (caar (org-babel-execute-src-block
+				   nil (org-babel-lob-get-info)))))
+	(forward-line 1) (beginning-of-line)
+	(should
+	 (= 4 (org-babel-execute-src-block nil (org-babel-lob-get-info))))
+	(forward-line 1)
+	(should
+	 (string= "testing" (org-babel-execute-src-block
+			     nil (org-babel-lob-get-info))))
 	(forward-line 1)
 	(should (string= "123" (org-babel-execute-src-block
 				nil (org-babel-lob-get-info))))))))
@@ -150,9 +149,8 @@ (ert-deftest test-ob-lob/caching-call-line ()
 <point>#+call: call-line-caching-example(\"qux\") :cache yes
 "
       ;; first execution should flip value to t
-      (org-test-ignore-duplicate
-        (should
-         (eq (org-babel-execute-src-block nil (org-babel-lob-get-info)) 1)))
+      (should
+       (eq (org-babel-execute-src-block nil (org-babel-lob-get-info)) 1))
       ;; if cached, second evaluation will retain the t value
       (should
        (eq (org-babel-execute-src-block nil (org-babel-lob-get-info)) 1)))))
@@ -169,9 +167,8 @@ (ert-deftest test-ob-lob/named-caching-call-line ()
 <point>#+call: call-line-caching-example(\"qux\") :cache yes
 "
       ;; first execution should flip value to t
-      (org-test-ignore-duplicate
-        (should
-         (eq (org-babel-execute-src-block nil (org-babel-lob-get-info)) 1)))
+      (should
+       (eq (org-babel-execute-src-block nil (org-babel-lob-get-info)) 1))
       ;; if cached, second evaluation will retain the t value
       (should
        (eq (org-babel-execute-src-block nil (org-babel-lob-get-info)) 1)))))
diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index c16b47954..afa414294 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -362,15 +362,13 @@ (ert-deftest test-ob/inline-src_blk-default-results-replace-line-1 ()
     (org-test-with-temp-text
 	test-line
       (goto-char (point-min)) (org-babel-execute-maybe)
-      (org-test-ignore-duplicate
-        (should (string=
-                 (concat test-line " {{{results(=1=)}}}")
-       	         (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
+      (should (string=
+               (concat test-line " {{{results(=1=)}}}")
+       	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
       (forward-char) (org-babel-execute-maybe)
-      (org-test-ignore-duplicate
-        (should (string=
-                 (concat test-line " {{{results(=1=)}}}")
-       	         (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
+      (should (string=
+               (concat test-line " {{{results(=1=)}}}")
+       	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
       (re-search-forward "{{{")
      ;;(should-error (org-ctrl-c-ctrl-c))
       (backward-char 4) ;; last char of block body
@@ -382,13 +380,11 @@ (ert-deftest test-ob/inline-src_blk-default-results-replace-line-1 ()
     (let ((test-line " src_emacs-lisp{ 1 }"))
       (org-test-with-temp-text
 	  test-line
-	(org-test-ignore-duplicate
-          (should-error (org-ctrl-c-ctrl-c)))
+        (should-error (org-ctrl-c-ctrl-c))
 	(forward-char) (org-babel-execute-maybe)
-	(org-test-ignore-duplicate
-          (should (string=
-		   (concat test-line " {{{results(=1=)}}}")
-		   (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
+        (should (string=
+		 (concat test-line " {{{results(=1=)}}}")
+		 (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
 	(re-search-forward "{ 1 ") (org-babel-execute-maybe)
 	(should (string=
 		 (concat test-line " {{{results(=1=)}}}")
@@ -430,11 +426,9 @@ (ert-deftest test-ob/inline-src_blk-default-results-replace-line-2 ()
 	(org-babel-inline-result-wrap "=%s="))
     (org-test-with-temp-text
 	(concat "\n" test-line)
-      (org-test-ignore-duplicate
-        (should-error (org-ctrl-c-ctrl-c)))
+      (should-error (org-ctrl-c-ctrl-c))
       (goto-char (point-min))
-      (org-test-ignore-duplicate
-        (should-error (org-ctrl-c-ctrl-c)))
+      (should-error (org-ctrl-c-ctrl-c))
       (forward-line)
       (should-error (org-ctrl-c-ctrl-c))
       (forward-char) (org-babel-execute-maybe)
@@ -449,10 +443,9 @@ (ert-deftest test-ob/inline-src_blk-default-results-replace-line-2 ()
       (goto-char (point-max))
       (insert (concat "\n" test-line " end"))
       (re-search-backward "src") (org-babel-execute-maybe)
-      (org-test-ignore-duplicate
-        (should (string=
-	         (concat test-line " {{{results(=y=)}}} end")
-	         (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
+      (should (string=
+	       (concat test-line " {{{results(=y=)}}} end")
+	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
       (re-search-forward "\" ") (org-babel-execute-maybe)
       (should (string=
 	       (concat test-line " {{{results(=y=)}}} end")
@@ -465,8 +458,7 @@ (ert-deftest test-ob/inline-src_blk-manual-results-replace ()
 	(org-babel-inline-result-wrap "=%s="))
     (org-test-with-temp-text
 	(concat "\n" test-line)
-      (org-test-ignore-duplicate
-        (should-error (org-ctrl-c-ctrl-c)))
+      (should-error (org-ctrl-c-ctrl-c))
       (goto-char (point-max))
       (org-babel-execute-maybe)
       (beginning-of-line)
@@ -483,13 +475,12 @@ (ert-deftest test-ob/inline-src_blk-manual-results-replace ()
       (goto-char (point-max))
       (insert (concat "\n" test-line " end"))
       (re-search-backward "src") (org-babel-execute-maybe)
-      (org-test-ignore-duplicate
-        (should (string=
-                 (concat test-line " {{{results(=y=)}}} end")
-    	         (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
+      (should (string=
+               (concat test-line " {{{results(=y=)}}} end")
+    	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
       (re-search-forward "\" ") (org-babel-execute-maybe)
       (should (string=
-              (concat test-line " {{{results(=y=)}}} end")
+               (concat test-line " {{{results(=y=)}}} end")
     	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
       (forward-char 3)
       (should-error (org-ctrl-c-ctrl-c)))))
@@ -508,10 +499,9 @@ (ert-deftest test-ob/inline-src_blk-results-silent ()
       (goto-char (point-max))
       (insert (concat "\n" test-line " end"))
       (re-search-backward "src_") (org-babel-execute-maybe)
-      (org-test-ignore-duplicate
-        (should (string= (concat test-line " end")
-		         (buffer-substring-no-properties
-			  (point-at-bol) (point-at-eol)))))
+      (should (string= (concat test-line " end")
+		       (buffer-substring-no-properties
+			(point-at-bol) (point-at-eol))))
       (re-search-forward "\" ") (org-babel-execute-maybe)
       (should (string= (concat test-line " end")
 		       (buffer-substring-no-properties
@@ -654,8 +644,7 @@ (ert-deftest test-ob/just-one-results-block ()
   (org-test-with-temp-text "#+begin_src sh :results output\necho Hello\n#+end_src\n"
     (org-babel-execute-src-block)
     (org-babel-execute-src-block)     ; second code block execution
-    (org-test-ignore-duplicate
-      (should (search-forward "Hello"))) ; the string inside the source code block
+    (should (search-forward "Hello")) ; the string inside the source code block
     (should (search-forward "Hello")) ; the same string in the results block
     (should-error (search-forward "Hello"))))
 
@@ -1170,10 +1159,9 @@ (ert-deftest test-ob/remove-inline-result ()
 			(point-at-bol) (point-at-eol))))
       ;; Delete whitespace and result.
       (org-babel-remove-inline-result)
-      (org-test-ignore-duplicate
-        (should (string= inline-sb-dot
-		         (buffer-substring-no-properties
-			  (point-at-bol) (point-at-eol)))))
+      (should (string= inline-sb-dot
+		       (buffer-substring-no-properties
+			(point-at-bol) (point-at-eol))))
       ;; Add whitespace and result before dot.
       (search-forward inline-sb)
       (insert "     " inline-res)
@@ -2478,32 +2466,31 @@ (1+ 1)
 #+RESULTS: abc
 : 2
 "
-      (org-test-ignore-duplicate
-        ;; non-existent name
-        (should-not
-         (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\nno-name\n"))
-        ;; correct name
-        (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\nabc\n")
-        (should  (= 14 (point)))
-        ;; call line   - autocompletion
-        (forward-line 3)
-        (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\n\n")
-        (should  (= 14 (point)))
-        ;; noweb reference  - autocompletion
-        (forward-line 5)
-        (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\n\n")
-        (should  (= 14 (point)))
-        ;; at symbol  - autocompletion
-        (forward-line 7)
-        (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\n\n")
-        (should  (= 14 (point)))
-        ;; in results  - autocompletion
-        (forward-line 8)
-        (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\n\n")
-        (should  (= 14 (point)))
-        (forward-line 9)
-        (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\n\n")
-        (should  (= 14 (point))))))
+    ;; non-existent name
+    (should-not
+     (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\nno-name\n"))
+    ;; correct name
+    (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\nabc\n")
+    (should  (= 14 (point)))
+    ;; call line   - autocompletion
+    (forward-line 3)
+    (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\n\n")
+    (should  (= 14 (point)))
+    ;; noweb reference  - autocompletion
+    (forward-line 5)
+    (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\n\n")
+    (should  (= 14 (point)))
+    ;; at symbol  - autocompletion
+    (forward-line 7)
+    (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\n\n")
+    (should  (= 14 (point)))
+    ;; in results  - autocompletion
+    (forward-line 8)
+    (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\n\n")
+    (should  (= 14 (point)))
+    (forward-line 9)
+    (execute-kbd-macro  "\M-xorg-babel-goto-named-src-block\n\n")
+    (should  (= 14 (point)))))
 
 (ert-deftest test-ob/evaluate-body-with-coderefs ()
   (should
diff --git a/testing/lisp/test-ol.el b/testing/lisp/test-ol.el
index 6a44e5bdc..e0cec0854 100644
--- a/testing/lisp/test-ol.el
+++ b/testing/lisp/test-ol.el
@@ -60,24 +60,23 @@ (ert-deftest test-org-link/toggle-link-display ()
   (dolist (org-link-descriptive '(nil t))
     (org-test-with-temp-text "* Org link test
 [[https://example.com][A link to a site]]"
-      (org-test-ignore-duplicate
-        (dotimes (_ 2)
-          (goto-char 1)
-          (re-search-forward "\\[")
-          (should-not (org-xor org-link-descriptive (org-invisible-p)))
-          (re-search-forward "example")
-          (should-not (org-xor org-link-descriptive (org-invisible-p)))
-          (re-search-forward "com")
-          (should-not (org-xor org-link-descriptive (org-invisible-p)))
-          (re-search-forward "]")
-          (should-not (org-xor org-link-descriptive (org-invisible-p)))
-          (re-search-forward "\\[")
-          (should-not (org-invisible-p))
-          (re-search-forward "link")
-          (should-not (org-invisible-p))
-          (re-search-forward "]")
-          (should-not (org-xor org-link-descriptive (org-invisible-p)))
-          (org-toggle-link-display))))))
+      (dotimes (_ 2)
+        (goto-char 1)
+        (re-search-forward "\\[")
+        (should-not (org-xor org-link-descriptive (org-invisible-p)))
+        (re-search-forward "example")
+        (should-not (org-xor org-link-descriptive (org-invisible-p)))
+        (re-search-forward "com")
+        (should-not (org-xor org-link-descriptive (org-invisible-p)))
+        (re-search-forward "]")
+        (should-not (org-xor org-link-descriptive (org-invisible-p)))
+        (re-search-forward "\\[")
+        (should-not (org-invisible-p))
+        (re-search-forward "link")
+        (should-not (org-invisible-p))
+        (re-search-forward "]")
+        (should-not (org-xor org-link-descriptive (org-invisible-p)))
+        (org-toggle-link-display)))))
 
 \f
 ;;; Escape and Unescape Links
diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el
index ce7ae3c63..976d88a9e 100644
--- a/testing/lisp/test-org-agenda.el
+++ b/testing/lisp/test-org-agenda.el
@@ -346,8 +346,7 @@ (ert-deftest test-org-agenda/property-timestamp ()
     ;; `org-today' or not.
     (org-agenda-list nil "<2022-03-22 Tue>")
     (set-buffer org-agenda-buffer-name)
-    (org-test-ignore-duplicate
-      (should (= 3 (count-lines (point-min) (point-max)))))
+    (should (= 3 (count-lines (point-min) (point-max))))
     ;; NOTE: Be aware that `org-agenda-list' may or may not display
     ;; past scheduled items depending whether the date is today
     ;; `org-today' or not.
@@ -444,16 +443,14 @@ (ert-deftest test-org-agenda/sticky-agenda-filter-preset ()
       (set-buffer "*Org Agenda(f)*")
       (org-agenda-redo)
       (goto-char (point-min))
-      (org-test-ignore-duplicate
-        (should (not (invisible-p (1- (search-forward "TODO Foo"))))))
+      (should (not (invisible-p (1- (search-forward "TODO Foo")))))
       (org-test-agenda--kill-all-agendas)
       (org-agenda nil "f1")
       (org-agenda nil "b1")
       (set-buffer "*Org Agenda(f1:+CATEGORY=\"foo\")*")
       (org-agenda-redo)
       (goto-char (point-min))
-      (org-test-ignore-duplicate
-        (should (not (invisible-p (1- (search-forward "TODO Foo"))))))
+      (should (not (invisible-p (1- (search-forward "TODO Foo")))))
       (org-test-agenda--kill-all-agendas)
       (org-agenda nil "f2")
       (org-agenda nil "b2")
diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el
index 6e0e5c5ec..ca7d77e28 100644
--- a/testing/lisp/test-org-element.el
+++ b/testing/lisp/test-org-element.el
@@ -5203,12 +5203,11 @@ (ert-deftest test-org-element/cache-headline ()
         (org-element-at-point))
       (insert ":CATEOGORY: cat\n")
       (search-backward "* Heading")
-      (org-test-ignore-duplicate
-        (should
-         (eq (org-element-property :end (org-element-at-point))
-             (save-excursion
-               (search-forward "* Heading 2")
-               (line-beginning-position)))))
+      (should
+       (eq (org-element-property :end (org-element-at-point))
+           (save-excursion
+             (search-forward "* Heading 2")
+             (line-beginning-position))))
       (search-forward "* Heading 2")
       (beginning-of-line)
       (insert "\n\n")
@@ -5248,10 +5247,9 @@ (ert-deftest test-org-element/cache-headline ()
       (org-element-at-point (point-max))
       (insert "* heading 2")
       (beginning-of-line)
-      (org-test-ignore-duplicate
-        (should
-         (eq (point-max)
-             (org-element-property :end (org-element-at-point)))))
+      (should
+       (eq (point-max)
+           (org-element-property :end (org-element-at-point))))
       (delete-char 1)
       (search-backward "* Heading")
       (should
diff --git a/testing/lisp/test-org-fold.el b/testing/lisp/test-org-fold.el
index 7fd4b015c..9f15f0a38 100644
--- a/testing/lisp/test-org-fold.el
+++ b/testing/lisp/test-org-fold.el
@@ -329,21 +329,20 @@ (ert-deftest test-org-fold/set-visibility-according-to-property ()
 ** AC
 * B
 "
-    (org-test-ignore-duplicate
-      (org-set-regexps-and-options)
-      (org-cycle-set-startup-visibility)
-      (search-forward "A")
-      (should-not (invisible-p (point)))
-      (search-forward "AB")
-      (should (invisible-p (point)))
-      (search-forward "ABA")
-      (should (invisible-p (point)))
-      (search-forward "ABAB")
-      (should (invisible-p (point)))
-      (search-forward "AC")
-      (should (invisible-p (point)))
-      (search-forward "B")
-      (should-not (invisible-p (point)))))
+    (org-set-regexps-and-options)
+    (org-cycle-set-startup-visibility)
+    (search-forward "A")
+    (should-not (invisible-p (point)))
+    (search-forward "AB")
+    (should (invisible-p (point)))
+    (search-forward "ABA")
+    (should (invisible-p (point)))
+    (search-forward "ABAB")
+    (should (invisible-p (point)))
+    (search-forward "AC")
+    (should (invisible-p (point)))
+    (search-forward "B")
+    (should-not (invisible-p (point))))
   ;; "children" state.
   (should
    (org-test-with-temp-text
diff --git a/testing/lisp/test-org-list.el b/testing/lisp/test-org-list.el
index 89c42b400..0ee3a14c2 100644
--- a/testing/lisp/test-org-list.el
+++ b/testing/lisp/test-org-list.el
@@ -61,14 +61,11 @@ (ert-deftest test-org-list/list-navigation ()
       ;;      a list/sub-list, unless `org-list-use-circular-motion'
       ;;      is non-nil.
       (goto-line 9)
-      (org-test-ignore-duplicate
-        (should-error (org-next-item)))
-      (org-test-ignore-duplicate
-        (let ((org-list-use-circular-motion t))
-	  (should (progn (org-next-item) t))))
+      (should-error (org-next-item))
+      (let ((org-list-use-circular-motion t))
+	(should (progn (org-next-item) t)))
       (goto-line 14)
-      (org-test-ignore-duplicate
-        (should-error (org-next-item)))
+      (should-error (org-next-item))
       (let ((org-list-use-circular-motion t))
 	(should (progn (org-next-item) t)))
       ;; 1.2. Should jump over sub-lists.
@@ -94,14 +91,11 @@ (ert-deftest test-org-list/list-navigation ()
       ;;      a list/sub-list, unless `org-list-use-circular-motion is
       ;;      non-nil.
       (goto-line 7)
-      (org-test-ignore-duplicate
-        (should-error (org-previous-item)))
-      (org-test-ignore-duplicate
-        (let ((org-list-use-circular-motion t))
-	  (should (progn (org-previous-item) t))))
+      (should-error (org-previous-item))
+      (let ((org-list-use-circular-motion t))
+	(should (progn (org-previous-item) t)))
       (goto-line 13)
-      (org-test-ignore-duplicate
-        (should-error (org-previous-item)))
+      (should-error (org-previous-item))
       (let ((org-list-use-circular-motion t))
 	(should (progn (org-previous-item) t)))
       ;; 2.2. Should ignore sub-lists.
@@ -711,8 +705,7 @@ (ert-deftest test-org-list/move-item-down ()
     (search-backward "- item 1")
     (org-move-item-down)
     (search-forward "sub-body 1")
-    (org-test-ignore-duplicate
-      (should (org-invisible-p2)))
+    (should (org-invisible-p2))
     (search-backward "sub-body 2")
     (should (org-invisible-p2))))
 
@@ -791,8 +784,7 @@ (ert-deftest test-org-list/move-item-up ()
       (org-cycle))
     (org-move-item-up)
     (forward-line)
-    (org-test-ignore-duplicate
-      (should (org-invisible-p2)))
+    (should (org-invisible-p2))
     (search-forward " body 1")
     (should (org-invisible-p2)))
   ;; Preserve children visibility.
@@ -811,8 +803,7 @@ (ert-deftest test-org-list/move-item-up ()
     (search-backward "- item 2")
     (org-move-item-up)
     (search-forward "sub-body 2")
-    (org-test-ignore-duplicate
-      (should (org-invisible-p2)))
+    (should (org-invisible-p2))
     (search-forward "sub-body 1")
     (should (org-invisible-p2))))
 
diff --git a/testing/lisp/test-org-src.el b/testing/lisp/test-org-src.el
index c079cc464..ebf8d8569 100644
--- a/testing/lisp/test-org-src.el
+++ b/testing/lisp/test-org-src.el
@@ -54,8 +54,7 @@ (ert-deftest test-org-src/point-outside-block ()
 #+end_src
 "
     (goto-line 1)
-    (org-test-ignore-duplicate
-      (should-error (org-edit-special)))
+    (should-error (org-edit-special))
     (goto-char (point-max))
     (should-error (org-edit-special))))
 
diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el
index 8eda95f3e..68b8efaea 100644
--- a/testing/lisp/test-org-table.el
+++ b/testing/lisp/test-org-table.el
@@ -1120,8 +1120,7 @@ (ert-deftest test-org-table/org-at-TBLFM-p ()
 "
     (goto-char (point-min))
     (forward-line 2)
-    (org-test-ignore-duplicate
-      (should (equal (org-at-TBLFM-p) nil)))
+    (should (equal (org-at-TBLFM-p) nil))
 
     (goto-char (point-min))
     (forward-line 3)
@@ -1140,8 +1139,7 @@ (ert-deftest test-org-table/org-table-TBLFM-begin ()
 
 "
     (goto-char (point-min))
-    (org-test-ignore-duplicate
-      (should (equal (org-table-TBLFM-begin) nil)))
+    (should (equal (org-table-TBLFM-begin) nil))
 
     (goto-char (point-min))
     (forward-line 1)
@@ -1149,8 +1147,7 @@ (ert-deftest test-org-table/org-table-TBLFM-begin ()
 
     (goto-char (point-min))
     (forward-line 3)
-    (org-test-ignore-duplicate
-      (should (= (org-table-TBLFM-begin) 14)))
+    (should (= (org-table-TBLFM-begin) 14))
 
     (goto-char (point-min))
     (forward-line 4)
@@ -1166,25 +1163,24 @@ (ert-deftest test-org-table/org-table-TBLFM-begin-for-multiple-TBLFM-lines ()
 #+TBLFM: $2=$1*2
 
 "
-    (org-test-ignore-duplicate
-      (goto-char (point-min))
-      (should (equal (org-table-TBLFM-begin) nil))
+    (goto-char (point-min))
+    (should (equal (org-table-TBLFM-begin) nil))
 
-      (goto-char (point-min))
-      (forward-line 1)
-      (should (equal (org-table-TBLFM-begin) nil))
+    (goto-char (point-min))
+    (forward-line 1)
+    (should (equal (org-table-TBLFM-begin) nil))
 
-      (goto-char (point-min))
-      (forward-line 3)
-      (should (= (org-table-TBLFM-begin) 14))
+    (goto-char (point-min))
+    (forward-line 3)
+    (should (= (org-table-TBLFM-begin) 14))
 
-      (goto-char (point-min))
-      (forward-line 4)
-      (should (= (org-table-TBLFM-begin) 14))
+    (goto-char (point-min))
+    (forward-line 4)
+    (should (= (org-table-TBLFM-begin) 14))
 
-      (goto-char (point-min))
-      (forward-line 5)
-      (should (= (org-table-TBLFM-begin) 14)))))
+    (goto-char (point-min))
+    (forward-line 5)
+    (should (= (org-table-TBLFM-begin) 14))))
 
 (ert-deftest test-org-table/org-table-TBLFM-begin-for-pultiple-TBLFM-lines-blocks ()
   (org-test-with-temp-text-in-file
@@ -1200,44 +1196,43 @@ (ert-deftest test-org-table/org-table-TBLFM-begin-for-pultiple-TBLFM-lines-block
 #+TBLFM: $2=$1*2
 
 "
-    (org-test-ignore-duplicate
-      (goto-char (point-min))
-      (should (equal (org-table-TBLFM-begin) nil))
+    (goto-char (point-min))
+    (should (equal (org-table-TBLFM-begin) nil))
 
-      (goto-char (point-min))
-      (forward-line 1)
-      (should (equal (org-table-TBLFM-begin) nil))
+    (goto-char (point-min))
+    (forward-line 1)
+    (should (equal (org-table-TBLFM-begin) nil))
 
-      (goto-char (point-min))
-      (forward-line 3)
-      (should (= (org-table-TBLFM-begin) 14))
+    (goto-char (point-min))
+    (forward-line 3)
+    (should (= (org-table-TBLFM-begin) 14))
 
-      (goto-char (point-min))
-      (forward-line 4)
-      (should (= (org-table-TBLFM-begin) 14))
+    (goto-char (point-min))
+    (forward-line 4)
+    (should (= (org-table-TBLFM-begin) 14))
 
-      (goto-char (point-min))
-      (forward-line 5)
-      (should (= (org-table-TBLFM-begin) 14))
+    (goto-char (point-min))
+    (forward-line 5)
+    (should (= (org-table-TBLFM-begin) 14))
 
-      (goto-char (point-min))
-      (forward-line 6)
-      (should (= (org-table-TBLFM-begin) 14))
+    (goto-char (point-min))
+    (forward-line 6)
+    (should (= (org-table-TBLFM-begin) 14))
 
-      (goto-char (point-min))
-      (forward-line 8)
-      (should (= (org-table-TBLFM-begin) 61))
+    (goto-char (point-min))
+    (forward-line 8)
+    (should (= (org-table-TBLFM-begin) 61))
 
-      (goto-char (point-min))
-      (forward-line 9)
-      (should (= (org-table-TBLFM-begin) 61))
+    (goto-char (point-min))
+    (forward-line 9)
+    (should (= (org-table-TBLFM-begin) 61))
 
-      (goto-char (point-min))
-      (forward-line 10)
-      (should (= (org-table-TBLFM-begin) 61)))))
+    (goto-char (point-min))
+    (forward-line 10)
+    (should (= (org-table-TBLFM-begin) 61))))
 
 (ert-deftest test-org-table/org-table-calc-current-TBLFM ()
-    (org-test-with-temp-text-in-file
+  (org-test-with-temp-text-in-file
       "
 | 1 |   |
 | 2 |   |
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index d379ee3bf..38f31cc91 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -2488,8 +2488,7 @@ (ert-deftest test-org/goto-sibling ()
     (should (org-goto-sibling))
     (should (looking-at-p "^\\*\\* Heading 3"))
     (should-not (org-goto-sibling))
-    (org-test-ignore-duplicate
-      (should (org-goto-sibling 'previous)))
+    (should (org-goto-sibling 'previous))
     (should (looking-at-p "^\\*\\* Heading 2"))
     (should (org-goto-sibling 'previous))
     (should (looking-at-p "^\\*\\* Heading 1"))
@@ -2532,8 +2531,7 @@ (ert-deftest test-org/goto-sibling ()
       (should (org-goto-sibling))
       (should (looking-at-p "^\\*\\* Heading 3"))
       (should-not (org-goto-sibling))
-      (org-test-ignore-duplicate
-        (should (org-goto-sibling 'previous)))
+      (should (org-goto-sibling 'previous))
       (should (looking-at-p "^\\*\\* Heading 2"))
       (should (org-goto-sibling 'previous))
       (should (looking-at-p "^\\*\\* Heading 1"))
@@ -4018,8 +4016,7 @@ (ert-deftest test-org/org-ctrl-c-ctrl-c ()
 * Heading<point>
 text"
     (org-overview)
-    (org-test-ignore-duplicate
-      (should (org-fold-folded-p (point) 'outline)))
+    (should (org-fold-folded-p (point) 'outline))
     (save-excursion
       (goto-char (point-min))
       (org-ctrl-c-ctrl-c))
@@ -5119,8 +5116,7 @@ (ert-deftest test-org/forward-element ()
     ;;      same level.
     (goto-line 3)
     (org-forward-element)
-    (org-test-ignore-duplicate
-      (should (looking-at (regexp-quote "** Head 1.2"))))
+    (should (looking-at (regexp-quote "** Head 1.2")))
     ;; 3.2. At an headline beginning: move to parent headline if no
     ;;      headline at the same level.
     (goto-line 3)
@@ -5131,8 +5127,7 @@ (ert-deftest test-org/forward-element ()
       "#+BEGIN_CENTER\nInside.\n#+END_CENTER\n\nOutside."
     ;; 4.1. At a greater element: expected to skip contents.
     (org-forward-element)
-    (org-test-ignore-duplicate
-      (should (looking-at (regexp-quote "Outside."))))
+    (should (looking-at (regexp-quote "Outside.")))
     ;; 4.2. At the end of greater element contents: expected to skip
     ;;      to the end of the greater element.
     (goto-line 2)
@@ -5171,8 +5166,7 @@ (ert-deftest test-org/forward-element ()
     ;; 5.3 At sub-list beginning: expected to move after the sub-list.
     (goto-line 4)
     (org-forward-element)
-    (org-test-ignore-duplicate
-      (should (looking-at (regexp-quote "  Inner paragraph."))))
+    (should (looking-at (regexp-quote "  Inner paragraph.")))
     ;; 5.4. At sub-list end: expected to move outside the sub-list.
     (goto-line 8)
     (org-forward-element)
@@ -5259,8 +5253,7 @@ (ert-deftest test-org/backward-element ()
     (should (looking-at "  - sub2"))
     (goto-line 12)
     (org-backward-element)
-    (org-test-ignore-duplicate
-      (should (looking-at "- item1")))
+    (should (looking-at "- item1"))
     ;; 7.3. At end of list/sub-list: expected to move to list/sub-list
     ;;      beginning.
     (goto-line 10)
@@ -5268,8 +5261,7 @@ (ert-deftest test-org/backward-element ()
     (should (looking-at "  - sub1"))
     (goto-line 15)
     (org-backward-element)
-    (org-test-ignore-duplicate
-      (should (looking-at "- item1")))
+    (should (looking-at "- item1"))
     ;; 7.4. At blank-lines before list end: expected to move to top
     ;; item.
     (goto-line 14)
@@ -5316,8 +5308,7 @@ (ert-deftest test-org/up-element ()
     ;; 4.2. At an item in a sub-list: move to parent item.
     (goto-line 4)
     (org-up-element)
-    (org-test-ignore-duplicate
-      (should (looking-at "- item1")))
+    (should (looking-at "- item1"))
     ;; 4.3. At an item in top list: move to beginning of whole list.
     (goto-line 10)
     (org-up-element)
-- 
2.43.0


[-- Attachment #3: Type: text/plain, Size: 224 bytes --]


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

  reply	other threads:[~2024-01-26 13:22 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 [this message]
2024-01-27  5:04                   ` Ilya Chernyshov
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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=871qa4fcs5.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=ichernyshovvv@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).