emacs-orgmode@gnu.org archives
 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: Tue, 23 Jan 2024 18:03:58 +0600	[thread overview]
Message-ID: <87il3kw91t.fsf@gmail.com> (raw)
In-Reply-To: <87il3tl7eb.fsf@localhost>

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

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-testing-lisp-test-duplicates-detector.el.patch --]
[-- Type: text/x-patch, Size: 45973 bytes --]

From 2385ba08a89f2966a6d71f92e8693e7def33e3fe Mon Sep 17 00:00:00 2001
From: Ilya Chernyshov <ichernyshovvv@gmail.com>
Date: Mon, 22 Jan 2024 01:33:56 +0600
Subject: [PATCH] Add testing/lisp/test-duplicates-detector.el

* testing/lisp/test-duplicates-detector.el: Add test unit that checks for
duplicate ert-deftests and forms inside of them.

* testing/lisp/test-org.el (test-org/file-contents): Delete duplicate
`should-' form.

* testing/lisp/test-ob-lob.el (test-ob-lob/call-with-header-arguments,
test-ob-lob/do-not-eval-lob-lines-in-example-blocks-on-export,
test-ob-lob/caching-call-line, test-ob-lob/named-caching-call-line,
test-ob/just-one-results-block): Ignore duplicate forms via
`org-test-ignore-duplicate'

* testing/lisp/test-ob.el (test-ob/just-one-results-block): Ignore
duplicate forms via `org-test-ignore-duplicate'

* testing/lisp/test-ob-R.el (test-ob-R/results-file): Ignore
duplicate forms via `org-test-ignore-duplicate'.

* testing/lisp/test-ob-haskell-ghci.el (ob-haskell/session-named-none-means-one-shot-sessions): Ignore
duplicate forms via `org-test-ignore-duplicate'.

* 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): Ignore
duplicate forms via `org-test-ignore-duplicate'.

* testing/lisp/test-org-agenda.el (test-org-agenda/property-timestamp,
test-org-agenda/sticky-agenda-filter-preset): Ignore
duplicate forms via `org-test-ignore-duplicate'

* testing/lisp/test-org-element.el (test-org-element/cache-headline):
Ignore duplicate forms via `org-test-ignore-duplicate'

* testing/lisp/test-org-fold.el (test-org-fold/set-visibility-according-to-property): Ignore duplicate
forms via `org-test-ignore-duplicate'

* testing/lisp/test-org-list.el (test-org-list/list-navigation,
test-org-list/move-item-down, test-org-list/move-item-up): Ignore duplicate
forms via `org-test-ignore-duplicate'

* testing/lisp/test-org-src.el (test-org-src/basic): Ignore duplicate
forms via `org-test-ignore-duplicate'

* 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):
Ignore duplicate forms via `org-test-ignore-duplicate'

* testing/lisp/test-org.el (test-org/goto-sibling,
test-org/backward-element, test-org/up-element,
test-org/org-ctrl-c-ctrl-c, test-org/forward-element): Ignore duplicate
forms via `org-test-ignore-duplicate'
---
 testing/lisp/test-duplicates-detector.el | 316 +++++++++++++++++++++++
 testing/lisp/test-ob-R.el                |   5 +-
 testing/lisp/test-ob-haskell-ghci.el     |   3 +-
 testing/lisp/test-ob-lob.el              |  87 ++++---
 testing/lisp/test-ob.el                  | 113 ++++----
 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           | 117 ++++-----
 testing/lisp/test-org.el                 |  38 ++-
 13 files changed, 568 insertions(+), 236 deletions(-)
 create mode 100644 testing/lisp/test-duplicates-detector.el

diff --git a/testing/lisp/test-duplicates-detector.el b/testing/lisp/test-duplicates-detector.el
new file mode 100644
index 000000000..d39092a9e
--- /dev/null
+++ b/testing/lisp/test-duplicates-detector.el
@@ -0,0 +1,316 @@
+;;; test-duplicates-detector.el --- Tests for finding duplicates in Org tests  -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2023  Ilya Chernyshov
+;; Authors: Ilya Chernyshov <ichernyshovvv@gmail.com>
+
+;; This file is not part of GNU Emacs.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+;;
+;;; Commentary:
+
+;; Unit tests that check for duplicate forms and tests in all Org test files.
+
+;; Forms are considered duplicate if they:
+
+;; 1. are `equal-including-properties',
+;; 2. have the same nesting path,
+;; 3. either are `should-' macros or have `should-' macros inside.
+
+;; To ignore a form or a group of forms, wrap them in
+;; `org-test-ignore-duplicate'.
+
+;; `ert-deftest' are considered duplicate if their body are
+;; `equal-including-properties.' When comparing, the docstrings are not taken
+;; into account.
+
+;;; Code:
+
+(require 'org-test "../testing/org-test")
+
+;;;; Variables
+
+(defvar test-duplicates-detector-file-path
+  (expand-file-name "test-duplicates-detector.el"
+                    (expand-file-name "lisp" org-test-dir)))
+
+(defvar test-duplicates-detector-files
+  (remove
+   test-duplicates-detector-file-path
+   (directory-files
+    (expand-file-name "lisp" org-test-dir) t "\\.el$")))
+
+(defvar test-duplicates-detector-duplicate-forms nil
+  "A nested list of the form:
+
+  (((file test-name [(form-1 . numerical-order)
+                     (form-2 . numerical-order) ...])
+    (dup-form-1 . (numerical-order [numerical-order ...]))
+  [ (dup-form-2 . (numerical-order [numerical-order ...]))
+    (dup-form-3 . (numerical-order [numerical-order ...]))
+     ...])
+   
+   ((file test-name [(form-1 . numerical-order)
+                     (form-2 . numerical-order) ...])
+    (dup-form-1 . (numerical-order [numerical-order ...]))
+  [ (dup-form-2 . (numerical-order [numerical-order ...]))
+    (dup-form-3 . (numerical-order [numerical-order ...]))
+     ...])
+
+   ...
+  )
+
+Where
+
+  (file test-name [(form-1 . numerical-order)
+                   (form-2 . numerical-order) ...])
+
+is a path to duplicates.  For example, the path for the
+duplicates in the following test:
+
+                                             test-ob-haskell-ghci.el
+
+  (ertdeftest 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'.\"
+    (let ((var-1 \"value\"))
+     (when var-1
+       (should-not
+        (equal 2 (test-ob-haskell-ghci \":session \"none\"\" \"x\" nil)))
+       (test-ob-haskell-ghci \":session none\" \"x=2\")
+       (should-not
+        (equal 2 (test-ob-haskell-ghci \":session \"none\"\" \"x\" nil)))
+       (test-ob-haskell-ghci \":session none\" \"x=2\"))))
+
+would look like this:
+
+  (\"test-ob-haskell-ghci.el\"
+    ob-haskell/session-named-none-means-one-shot-sessions
+    (let . 4) (when . 2))
+
+And the records about the duplicates would look like this:
+
+  ((test-ob-haskell-ghci \":session none\" \"x=2\") 5 3)
+  ((should-not
+    (equal 2 (test-ob-haskell-ghci \":session \"none\"\" \"x\" nil))) 4 2)")
+
+(defvar test-duplicates-detector-forms nil
+  "Nested alist of found forms and paths to them (not filtered).")
+
+;;;; Macros
+
+(defmacro org-test-ignore-duplicate (&rest body)
+  "Eval BODY forms sequentially and return value of last one.
+
+The macro's body will be ignored by `test-duplicates-detector.el'
+tests to skip duplicate forms inside the body."
+  (declare (indent 0))
+  `(progn ,@body))
+
+;;;; ERT tests
+
+(ert-deftest test-org-tests/find-duplicates ()
+  "Try to find duplicate forms and ert-deftests in FILES."
+  (should-not
+   (test-duplicates-detector--find-duplicates
+    test-duplicates-detector-files)))
+
+;;;; Auxiliary functions
+
+(defun test-duplicates-detector--find-duplicates (files)
+  "Try to find duplicate forms and ert-deftests in FILES.
+
+Duplicate forms will be written to
+`test-duplicates-detector-duplicate-forms'.
+
+`message' paths to them in a human-readable format."
+  (setq test-duplicates-detector-forms nil)
+  (let (found-deftests duplicate-tests)
+    (dolist (file files)
+      (with-current-buffer (find-file-noselect file)
+	(save-excursion
+          (goto-char (point-min))
+          (while (search-forward "(ert-deftest" nil t)
+            (goto-char (match-beginning 0))
+            (ignore-errors
+	      (while-let ((deftest (or (read (current-buffer)) t))
+			  ((eq (car deftest) 'ert-deftest))
+			  (test-name (cadr deftest)))
+		(if-let ((f (seq-find
+			     (lambda (x)
+			       (equal-including-properties
+				;; if cadddr is a docstring
+				(if (stringp (cadddr deftest))
+				    (cddddr deftest)
+				  (cdddr deftest))
+				(if (stringp (cadddr x))
+				    (cddddr x)
+				  (cdddr x))))
+			     found-deftests)))
+                    (push (cons test-name (cadr f)) duplicate-tests)
+		  (push deftest found-deftests))
+		(test-duplicates-detector--search-forms-recursively
+		 deftest (list file (cadr deftest)))))))))
+    (setq test-duplicates-detector-duplicate-forms
+          (seq-filter
+	   #'cdr
+	   (mapcar
+            (lambda (file)
+              (cons
+               (car file)
+               (seq-filter
+		(lambda (x)
+		  (and (caddr x)
+		       (seq-intersection
+			'(should-not should should-error)
+			(flatten-list (car x)))))
+		(cdr file))))
+            test-duplicates-detector-forms)))
+    (when test-duplicates-detector-duplicate-forms
+      (message
+       "Found duplicates (To ignore the duplicate forms,
+wrap them in `org-test-ignore-duplicate'):
+%s"
+       (mapconcat
+	(lambda (path)
+	  (let* ((file (file-relative-name (caar path)))
+		 (test-name (symbol-name (cadar path)))
+		 (string-path (append (list file test-name)
+				      (mapcar (lambda (x)
+						(symbol-name (car x)))
+					      (cddar path))))
+		 (indent -1)
+		 (print-level 3))
+	    (concat
+	     (mapconcat
+	      (lambda (x)
+		(concat (make-string (* (setq indent (1+ indent)) 2) ? )
+			x "\n"))
+	      string-path)
+	     (mapconcat
+	      (lambda (x)
+		(format "%s%S: %d times\n"
+			(make-string (* indent 2) ? )
+			(car x)
+			(length (cdr x))))
+	      (cdr path)))))
+	test-duplicates-detector-duplicate-forms)))
+    (when duplicate-tests
+      (message "Duplicate ERT tests found:\n%s\n"
+	       (mapconcat (lambda (x) (format "%S" x))
+			  duplicate-tests "\n")))
+    (append test-duplicates-detector-duplicate-forms
+	    duplicate-tests)))
+
+(defun test-duplicates-detector--search-forms-recursively (form form-path)
+  "Search for forms recursively in FORM.
+
+FORM-PATH is list of the form:
+  (\"file-path\" ert-test-symbol
+    (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))
+		    '(should-not should should-error))
+	(test-duplicates-detector--search-forms-recursively
+         (nth iter form)
+         (append form-path (list (cons (car (nth iter form)) iter))))))))
+
+;;;; Testing the detector itself
+
+(ert-deftest test-duplicates-detector-testing-find-duplicates ()
+  "Test `test-duplicates-detector--find-duplicates'."
+  (should
+   (equal
+    (test-duplicates-detector--find-duplicates
+     (list test-duplicates-detector-file-path))
+    `((((,test-duplicates-detector-file-path
+	 test-org-tests/test-with-nested-duplicates)
+	((let ((var "string")) (should (message "123 %s" var))) 6 4))
+       ((,test-duplicates-detector-file-path
+	 test-org-tests/test-with-duplicates-at-root)
+	((should (message "123")) 6 4)))
+      ((test-org-tests/duplicate-test-2 . test-org-tests/duplicate-test-1))))))
+
+;;;;; Tests with duplicate forms
+
+(ert-deftest test-org-tests/test-with-duplicates-at-root ()
+  "Test with duplicates at the root."
+  (should (message "123"))
+  (format "%s" "string")
+  (should
+   (message "123")))
+
+(ert-deftest test-org-tests/test-with-nested-duplicates ()
+  "Test with nested duplicates."
+  (let ((var "string"))
+    (should
+     (message "123 %s" var)))
+  (format "%s" "string")
+  (let ((var "string"))
+    (should (message "123 %s" var)))
+  (format "%s" "string"))
+
+;;;;; Tests without duplicates
+
+(ert-deftest test-org-tests/test-without-duplicates-1 ()
+  "Test without duplicates."
+  (let ((var-1 "asd"))
+    (concat "string" var-1))
+  (should
+   (let ((var-1 "asd"))
+     (concat "string" var-1))))
+
+(ert-deftest test-org-tests/test-without-duplicates-2 ()
+  "Test without duplicates.
+Equal `should' macros, but different nesting paths."
+  (let ((var "string"))
+    (should (format "123 %s" "asd")))
+  (+ 5 6 9)
+  (should (format "123 %s" "asd")))
+
+;;;;; Duplicate deftests (maybe different names, but same body)
+
+(ert-deftest test-org-tests/duplicate-test-1 ()
+  "Docstring of duplicate-test-1."
+  (let ((var 99))
+    (+ 5 6 9 var)
+    (should (format "123 %s" "asd")))
+  (should (format "123 %s" "asd")))
+
+(ert-deftest test-org-tests/duplicate-test-2 ()
+  "Docstring of duplicate-test-2."
+  (let ((var 99))
+    (+ 5 6 9 var)
+    (should (format "123 %s" "asd")))
+  (should (format "123 %s" "asd")))
+
+(provide 'test-duplicates-detector)
+
+;; Local Variables:
+;;   outline-regexp: "\\(;\\{3,\\} \\)"
+;; End:
+
+;;; test-duplicates-detector.el ends here
diff --git a/testing/lisp/test-ob-R.el b/testing/lisp/test-ob-R.el
index 9ffbf3afd..52e093edd 100644
--- a/testing/lisp/test-ob-R.el
+++ b/testing/lisp/test-ob-R.el
@@ -98,8 +98,9 @@ x
 #+END_SRC"
      (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))))
+     (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)
diff --git a/testing/lisp/test-ob-haskell-ghci.el b/testing/lisp/test-ob-haskell-ghci.el
index cbd5f6f9a..55c0eb2b8 100644
--- a/testing/lisp/test-ob-haskell-ghci.el
+++ b/testing/lisp/test-ob-haskell-ghci.el
@@ -118,7 +118,8 @@ main
   "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)
-  (should-not (equal 2 (test-ob-haskell-ghci ":session \"none\"" "x" nil)))
+  (org-test-ignore-duplicate
+    (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 188fee4c0..1a3fdff16 100644
--- a/testing/lisp/test-ob-lob.el
+++ b/testing/lisp/test-ob-lob.el
@@ -62,44 +62,45 @@
 	(move-beginning-of-line 1)
 	(forward-line 6)
 	(message (buffer-substring (point-at-bol) (point-at-eol)))
-	(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))))
+	(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)))))
 	(forward-line 1)
 	(should (string= "123" (org-babel-execute-src-block
 				nil (org-babel-lob-get-info))))))))
@@ -149,8 +150,9 @@ for export
 <point>#+call: call-line-caching-example(\"qux\") :cache yes
 "
       ;; first execution should flip value to t
-      (should
-       (eq (org-babel-execute-src-block nil (org-babel-lob-get-info)) 1))
+      (org-test-ignore-duplicate
+        (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)))))
@@ -167,8 +169,9 @@ for export
 <point>#+call: call-line-caching-example(\"qux\") :cache yes
 "
       ;; first execution should flip value to t
-      (should
-       (eq (org-babel-execute-src-block nil (org-babel-lob-get-info)) 1))
+      (org-test-ignore-duplicate
+        (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 42c77ca56..c16b47954 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -362,13 +362,15 @@ at the beginning of a line."
     (org-test-with-temp-text
 	test-line
       (goto-char (point-min)) (org-babel-execute-maybe)
-      (should (string=
-                      (concat test-line " {{{results(=1=)}}}")
-       	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
+      (org-test-ignore-duplicate
+        (should (string=
+                 (concat test-line " {{{results(=1=)}}}")
+       	         (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
       (forward-char) (org-babel-execute-maybe)
-      (should (string=
-                      (concat test-line " {{{results(=1=)}}}")
-       	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
+      (org-test-ignore-duplicate
+        (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
@@ -380,11 +382,13 @@ at the beginning of a line."
     (let ((test-line " src_emacs-lisp{ 1 }"))
       (org-test-with-temp-text
 	  test-line
-	(should-error (org-ctrl-c-ctrl-c))
+	(org-test-ignore-duplicate
+          (should-error (org-ctrl-c-ctrl-c)))
 	(forward-char) (org-babel-execute-maybe)
-	(should (string=
-		 (concat test-line " {{{results(=1=)}}}")
-		 (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
+	(org-test-ignore-duplicate
+          (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=)}}}")
@@ -426,9 +430,11 @@ at the beginning of a line."
 	(org-babel-inline-result-wrap "=%s="))
     (org-test-with-temp-text
 	(concat "\n" test-line)
-      (should-error (org-ctrl-c-ctrl-c))
+      (org-test-ignore-duplicate
+        (should-error (org-ctrl-c-ctrl-c)))
       (goto-char (point-min))
-      (should-error (org-ctrl-c-ctrl-c))
+      (org-test-ignore-duplicate
+        (should-error (org-ctrl-c-ctrl-c)))
       (forward-line)
       (should-error (org-ctrl-c-ctrl-c))
       (forward-char) (org-babel-execute-maybe)
@@ -443,9 +449,10 @@ at the beginning of a line."
       (goto-char (point-max))
       (insert (concat "\n" test-line " end"))
       (re-search-backward "src") (org-babel-execute-maybe)
-      (should (string=
-	       (concat test-line " {{{results(=y=)}}} end")
-	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
+      (org-test-ignore-duplicate
+        (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")
@@ -458,7 +465,8 @@ at the beginning of a line."
 	(org-babel-inline-result-wrap "=%s="))
     (org-test-with-temp-text
 	(concat "\n" test-line)
-      (should-error (org-ctrl-c-ctrl-c))
+      (org-test-ignore-duplicate
+        (should-error (org-ctrl-c-ctrl-c)))
       (goto-char (point-max))
       (org-babel-execute-maybe)
       (beginning-of-line)
@@ -475,9 +483,10 @@ at the beginning of a line."
       (goto-char (point-max))
       (insert (concat "\n" test-line " end"))
       (re-search-backward "src") (org-babel-execute-maybe)
-      (should (string=
-              (concat test-line " {{{results(=y=)}}} end")
-    	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
+      (org-test-ignore-duplicate
+        (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")
@@ -499,9 +508,10 @@ at the beginning of a line."
       (goto-char (point-max))
       (insert (concat "\n" test-line " end"))
       (re-search-backward "src_") (org-babel-execute-maybe)
-      (should (string= (concat test-line " end")
-		       (buffer-substring-no-properties
-			(point-at-bol) (point-at-eol))))
+      (org-test-ignore-duplicate
+        (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
@@ -644,7 +654,8 @@ duplicate 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
-    (should (search-forward "Hello")) ; the string inside the source code block
+    (org-test-ignore-duplicate
+      (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"))))
 
@@ -1159,9 +1170,10 @@ x
 			(point-at-bol) (point-at-eol))))
       ;; Delete whitespace and result.
       (org-babel-remove-inline-result)
-      (should (string= inline-sb-dot
-		       (buffer-substring-no-properties
-			(point-at-bol) (point-at-eol))))
+      (org-test-ignore-duplicate
+        (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)
@@ -2466,31 +2478,32 @@ abc
 #+RESULTS: abc
 : 2
 "
-       ;; non-existent name
-       (should-not
+      (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)))))
+        ;; 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 e0cec0854..6a44e5bdc 100644
--- a/testing/lisp/test-ol.el
+++ b/testing/lisp/test-ol.el
@@ -60,23 +60,24 @@ See https://github.com/yantar92/org/issues/4."
   (dolist (org-link-descriptive '(nil t))
     (org-test-with-temp-text "* Org link test
 [[https://example.com][A link to a site]]"
-      (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)))))
+      (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))))))
 
 \f
 ;;; Escape and Unescape Links
diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el
index 976d88a9e..ce7ae3c63 100644
--- a/testing/lisp/test-org-agenda.el
+++ b/testing/lisp/test-org-agenda.el
@@ -346,7 +346,8 @@ See https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com"
     ;; `org-today' or not.
     (org-agenda-list nil "<2022-03-22 Tue>")
     (set-buffer org-agenda-buffer-name)
-    (should (= 3 (count-lines (point-min) (point-max))))
+    (org-test-ignore-duplicate
+      (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.
@@ -443,14 +444,16 @@ See https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com"
       (set-buffer "*Org Agenda(f)*")
       (org-agenda-redo)
       (goto-char (point-min))
-      (should (not (invisible-p (1- (search-forward "TODO Foo")))))
+      (org-test-ignore-duplicate
+        (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))
-      (should (not (invisible-p (1- (search-forward "TODO Foo")))))
+      (org-test-ignore-duplicate
+        (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 ca7d77e28..6e0e5c5ec 100644
--- a/testing/lisp/test-org-element.el
+++ b/testing/lisp/test-org-element.el
@@ -5203,11 +5203,12 @@ Aliquam erat volutpat.
         (org-element-at-point))
       (insert ":CATEOGORY: cat\n")
       (search-backward "* Heading")
-      (should
-       (eq (org-element-property :end (org-element-at-point))
-           (save-excursion
-             (search-forward "* Heading 2")
-             (line-beginning-position))))
+      (org-test-ignore-duplicate
+        (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")
@@ -5247,9 +5248,10 @@ Aliquam erat volutpat.
       (org-element-at-point (point-max))
       (insert "* heading 2")
       (beginning-of-line)
-      (should
-       (eq (point-max)
-           (org-element-property :end (org-element-at-point))))
+      (org-test-ignore-duplicate
+        (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 9f15f0a38..7fd4b015c 100644
--- a/testing/lisp/test-org-fold.el
+++ b/testing/lisp/test-org-fold.el
@@ -329,20 +329,21 @@ Some text here
 ** AC
 * B
 "
-    (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-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)))))
   ;; "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 0ee3a14c2..89c42b400 100644
--- a/testing/lisp/test-org-list.el
+++ b/testing/lisp/test-org-list.el
@@ -61,11 +61,14 @@
       ;;      a list/sub-list, unless `org-list-use-circular-motion'
       ;;      is non-nil.
       (goto-line 9)
-      (should-error (org-next-item))
-      (let ((org-list-use-circular-motion t))
-	(should (progn (org-next-item) t)))
+      (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))))
       (goto-line 14)
-      (should-error (org-next-item))
+      (org-test-ignore-duplicate
+        (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.
@@ -91,11 +94,14 @@
       ;;      a list/sub-list, unless `org-list-use-circular-motion is
       ;;      non-nil.
       (goto-line 7)
-      (should-error (org-previous-item))
-      (let ((org-list-use-circular-motion t))
-	(should (progn (org-previous-item) t)))
+      (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))))
       (goto-line 13)
-      (should-error (org-previous-item))
+      (org-test-ignore-duplicate
+        (should-error (org-previous-item)))
       (let ((org-list-use-circular-motion t))
 	(should (progn (org-previous-item) t)))
       ;; 2.2. Should ignore sub-lists.
@@ -705,7 +711,8 @@ b. Item 2<point>"
     (search-backward "- item 1")
     (org-move-item-down)
     (search-forward "sub-body 1")
-    (should (org-invisible-p2))
+    (org-test-ignore-duplicate
+      (should (org-invisible-p2)))
     (search-backward "sub-body 2")
     (should (org-invisible-p2))))
 
@@ -784,7 +791,8 @@ b. Item 2<point>"
       (org-cycle))
     (org-move-item-up)
     (forward-line)
-    (should (org-invisible-p2))
+    (org-test-ignore-duplicate
+      (should (org-invisible-p2)))
     (search-forward " body 1")
     (should (org-invisible-p2)))
   ;; Preserve children visibility.
@@ -803,7 +811,8 @@ b. Item 2<point>"
     (search-backward "- item 2")
     (org-move-item-up)
     (search-forward "sub-body 2")
-    (should (org-invisible-p2))
+    (org-test-ignore-duplicate
+      (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 ebf8d8569..c079cc464 100644
--- a/testing/lisp/test-org-src.el
+++ b/testing/lisp/test-org-src.el
@@ -54,7 +54,8 @@
 #+end_src
 "
     (goto-line 1)
-    (should-error (org-edit-special))
+    (org-test-ignore-duplicate
+      (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 92ccd2a05..8eda95f3e 100644
--- a/testing/lisp/test-org-table.el
+++ b/testing/lisp/test-org-table.el
@@ -1120,7 +1120,8 @@ See also `test-org-table/copy-field'."
 "
     (goto-char (point-min))
     (forward-line 2)
-    (should (equal (org-at-TBLFM-p) nil))
+    (org-test-ignore-duplicate
+      (should (equal (org-at-TBLFM-p) nil)))
 
     (goto-char (point-min))
     (forward-line 3)
@@ -1139,25 +1140,21 @@ See also `test-org-table/copy-field'."
 
 "
     (goto-char (point-min))
-    (should (equal (org-table-TBLFM-begin)
-		   nil))
+    (org-test-ignore-duplicate
+      (should (equal (org-table-TBLFM-begin) nil)))
 
     (goto-char (point-min))
     (forward-line 1)
-    (should (equal (org-table-TBLFM-begin)
-		   nil))
+    (should (equal (org-table-TBLFM-begin) nil))
 
     (goto-char (point-min))
     (forward-line 3)
-    (should (= (org-table-TBLFM-begin)
-		   14))
+    (org-test-ignore-duplicate
+      (should (= (org-table-TBLFM-begin) 14)))
 
     (goto-char (point-min))
     (forward-line 4)
-    (should (= (org-table-TBLFM-begin)
-		   14))
-
-    ))
+    (should (= (org-table-TBLFM-begin) 14))))
 
 (ert-deftest test-org-table/org-table-TBLFM-begin-for-multiple-TBLFM-lines ()
   "For multiple #+TBLFM lines."
@@ -1169,31 +1166,25 @@ See also `test-org-table/copy-field'."
 #+TBLFM: $2=$1*2
 
 "
-    (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))
+    (org-test-ignore-duplicate
+      (goto-char (point-min))
+      (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 1)
+      (should (equal (org-table-TBLFM-begin) nil))
 
-    (goto-char (point-min))
-    (forward-line 4)
-    (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 5)
-    (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)))))
 
 (ert-deftest test-org-table/org-table-TBLFM-begin-for-pultiple-TBLFM-lines-blocks ()
   (org-test-with-temp-text-in-file
@@ -1209,49 +1200,41 @@ See also `test-org-table/copy-field'."
 #+TBLFM: $2=$1*2
 
 "
-    (goto-char (point-min))
-    (should (equal (org-table-TBLFM-begin)
-		   nil))
+    (org-test-ignore-duplicate
+      (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
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 822cbc67a..d379ee3bf 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -2488,7 +2488,8 @@ Text.
     (should (org-goto-sibling))
     (should (looking-at-p "^\\*\\* Heading 3"))
     (should-not (org-goto-sibling))
-    (should (org-goto-sibling 'previous))
+    (org-test-ignore-duplicate
+      (should (org-goto-sibling 'previous)))
     (should (looking-at-p "^\\*\\* Heading 2"))
     (should (org-goto-sibling 'previous))
     (should (looking-at-p "^\\*\\* Heading 1"))
@@ -2531,7 +2532,8 @@ test <point>
       (should (org-goto-sibling))
       (should (looking-at-p "^\\*\\* Heading 3"))
       (should-not (org-goto-sibling))
-      (should (org-goto-sibling 'previous))
+      (org-test-ignore-duplicate
+        (should (org-goto-sibling 'previous)))
       (should (looking-at-p "^\\*\\* Heading 2"))
       (should (org-goto-sibling 'previous))
       (should (looking-at-p "^\\*\\* Heading 1"))
@@ -3994,17 +3996,6 @@ SCHEDULED: <2017-05-06 Sat>
 	   (org-file-contents "http://this-url-must-not-exist"))
        (kill-buffer buffer))))
   ;; Try to access an invalid URL, but do not throw an error.
-  (should-error
-   (let ((buffer (generate-new-buffer "url-retrieve-output")))
-     (unwind-protect
-	 ;; Simulate unsuccessful retrieval of a URL.
-	 (cl-letf (((symbol-function 'url-retrieve-synchronously)
-		    (lambda (&rest_)
-		      (with-current-buffer buffer
-			(insert "HTTP/1.1 404 Not found\n\ndoes not matter"))
-		      buffer)))
-	   (org-file-contents "http://this-url-must-not-exist"))
-       (kill-buffer buffer))))
   (should
    (let ((buffer (generate-new-buffer "url-retrieve-output")))
      (unwind-protect
@@ -4027,7 +4018,8 @@ SCHEDULED: <2017-05-06 Sat>
 * Heading<point>
 text"
     (org-overview)
-    (should (org-fold-folded-p (point) 'outline))
+    (org-test-ignore-duplicate
+      (should (org-fold-folded-p (point) 'outline)))
     (save-excursion
       (goto-char (point-min))
       (org-ctrl-c-ctrl-c))
@@ -5127,7 +5119,8 @@ asd
     ;;      same level.
     (goto-line 3)
     (org-forward-element)
-    (should (looking-at (regexp-quote "** Head 1.2")))
+    (org-test-ignore-duplicate
+      (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)
@@ -5138,7 +5131,8 @@ asd
       "#+BEGIN_CENTER\nInside.\n#+END_CENTER\n\nOutside."
     ;; 4.1. At a greater element: expected to skip contents.
     (org-forward-element)
-    (should (looking-at (regexp-quote "Outside.")))
+    (org-test-ignore-duplicate
+      (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)
@@ -5177,7 +5171,8 @@ Outside."
     ;; 5.3 At sub-list beginning: expected to move after the sub-list.
     (goto-line 4)
     (org-forward-element)
-    (should (looking-at (regexp-quote "  Inner paragraph.")))
+    (org-test-ignore-duplicate
+      (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)
@@ -5264,7 +5259,8 @@ Outside."
     (should (looking-at "  - sub2"))
     (goto-line 12)
     (org-backward-element)
-    (should (looking-at "- item1"))
+    (org-test-ignore-duplicate
+      (should (looking-at "- item1")))
     ;; 7.3. At end of list/sub-list: expected to move to list/sub-list
     ;;      beginning.
     (goto-line 10)
@@ -5272,7 +5268,8 @@ Outside."
     (should (looking-at "  - sub1"))
     (goto-line 15)
     (org-backward-element)
-    (should (looking-at "- item1"))
+    (org-test-ignore-duplicate
+      (should (looking-at "- item1")))
     ;; 7.4. At blank-lines before list end: expected to move to top
     ;; item.
     (goto-line 14)
@@ -5319,7 +5316,8 @@ Outside."
     ;; 4.2. At an item in a sub-list: move to parent item.
     (goto-line 4)
     (org-up-element)
-    (should (looking-at "- item1"))
+    (org-test-ignore-duplicate
+      (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.41.0


  reply	other threads:[~2024-01-23 12:05 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 [this message]
2024-01-26 13:24                 ` Ihor Radchenko
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=87il3kw91t.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 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).