From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id ULwUKvyxs2WuUAAA62LTzQ:P1 (envelope-from ) for ; Fri, 26 Jan 2024 14:22:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id ULwUKvyxs2WuUAAA62LTzQ (envelope-from ) for ; Fri, 26 Jan 2024 14:22:04 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Ow1OsntU; 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=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1706275324; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=0cuMSoxa8n79xOBiBS55dM4oJhdMRooavXd6N9nxxf8=; b=ECNleKidEBDKoXo8tuoznN5oZdsFNL9Fgt+JXh9ObxCVr+jVQoKsNVfypdIOSXay9rkNLW XYOvEqZyxKUMNvZwS/LOqYvxUjmi8pqQXv5Brh8VUqCk0euHjQu+5BgYONthdEpl0AGqna NkHLXQlmm1b1OgM1pwBCzjS6TdNyI52dSTFAUjqjrGC1LsXcgBvjmbK0y/thkDlLUxGlO5 SPsTOdYcZHWekVXIRNVrg71d3mxfL3rDxoJJnYfAg6rutFeRxSMBjK+BMWTiTcgktUh14t iuVhmEBP8hCp+w8rTbYA9H7/7GBtVsMJ8j0eiAxDBeW5FPSsmo0ypXkBeMpLSw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Ow1OsntU; 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=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1706275324; a=rsa-sha256; cv=none; b=Mh3EDo0+25k/VBc9e2uvXu/bHkLZJBsONHSXXK8w1zZtUfvtOQYrdX+C8L74yHgtgJG099 a0iqKy1pujW78QJ1QtYYW+4IB9pZAdbcEdLGgswZ2yE7QM1y9MTRVnqIgaAlMOMptfTjr9 0oCRd8dWkGG0wKr77LYvGyR0Ke2JrMraymTjNbky5j54U4lw117jlRiNxU5bDVy2lNJsng TzNZF9DcVPPrzGSyqJCHw3obN55j+vvWCAigZesB2ycHKfqCfG66TUSa4GsLaI2bXJND5z teqJxeLcTj7dJSTatO0z+wzK14xoFjjvjoimFZZdxAocncmqD7ptrIOHSRMMnw== 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 EFA945EF3C for ; Fri, 26 Jan 2024 14:22:03 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTM8q-0004Aa-QG; Fri, 26 Jan 2024 08:21:09 -0500 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 1rTM8k-0004AI-92 for emacs-orgmode@gnu.org; Fri, 26 Jan 2024 08:21:02 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rTM8e-0004ho-GN for emacs-orgmode@gnu.org; Fri, 26 Jan 2024 08:21:01 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 03853240027 for ; Fri, 26 Jan 2024 14:20:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1706275254; bh=MkoeKcL1ljxmYrqnvkMZxMepPFFP/qc7De8n1TOrvC0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=Ow1OsntUmYU6uQIYNHXP0844aXvH17KuxRZTz1OZy45T9xdBNmvRkcSlA03Tik5cG D0h5W7Fi/OH9iH2dV5wus+F0LA+sacJ8VSvXHTtaZa7FkZxpBeUs/mcGJJMWKqy7J5 gVH0koYQmTO6wQG44IfSuLggacc7/qD1CY9Z9Qo9vV4RQ31fLvjb3pMM+fdcNbIgPu fvbxwu5zYHmAFfrd5eD5y1NA1AdFZ+a9c/C0bwJXdpyjGVxEkNlZQbNXrRqme9d+ql 4RzPg33kV80Pvz5j58P9rDwBAvCbBq+rbmrRyvWL7pOd/muBRL8MF2Q7nuRDN6+T/n mxcXQmf9wsqhQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TLyxc6hXPz9rxL; Fri, 26 Jan 2024 14:20:52 +0100 (CET) From: Ihor Radchenko To: Ilya Chernyshov Cc: emacs-orgmode Subject: Re: [PATCH] testing: Delete duplicate tests In-Reply-To: <87il3kw91t.fsf@gmail.com> References: <87cz0xndem.fsf@gmail.com> <87cz0wyw9m.fsf@localhost> <87y1ilitzo.fsf@localhost> <87fs3zybvj.fsf@gmail.com> <875y4viv14.fsf@localhost> <878r78ftvs.fsf@localhost> <87sf5cr7na.fsf@gmail.com> <87il3tl7eb.fsf@localhost> <87il3kw91t.fsf@gmail.com> Date: Fri, 26 Jan 2024 13:24:26 +0000 Message-ID: <871qa4fcs5.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-Spam-Score: -9.88 X-Migadu-Queue-Id: EFA945EF3C X-Spam-Score: -9.88 X-Migadu-Scanner: mx11.migadu.com X-TUID: f5MyzKJKPa1K --=-=-= Content-Type: text/plain Ilya Chernyshov writes: > Ihor Radchenko 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-test-duplicates-detector.el-Do-not-search-duplicates.patch >From b14840aa81784547a6dd03aec510e23c898d97ec Mon Sep 17 00:00:00 2001 Message-ID: From: Ihor Radchenko 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 () #+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 () #+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))))) ;;; 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 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 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--