emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH v2] org-test: Run all ol tests on make test
Date: Thu, 28 Jul 2022 22:14:29 +0700	[thread overview]
Message-ID: <tbu94l$15gk$1@ciao.gmane.io> (raw)
In-Reply-To: <87czdp9ulk.fsf@localhost>

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

On 28/07/2022 21:31, Ihor Radchenko wrote:
> Max Nikulin writes:
> 
>> On 27/07/2022 10:49, Ihor Radchenko wrote:
>>>
>>> You missed the
>>>
>>> 	(org-test-selector
>>> 	 (if org-test-selector org-test-selector "\\(org\\|ob\\)"))
>>
>> I have notices that cases in test-oc.el are named test-org-cite/... So I
>> am considering renaming tests in test-ol.el in the same way from
>> test-ol/... to test-org-link/... instead of modifying selectors. I have
>> not noticed with approach to naming is recommended.
> 
> Either way is fine. Ideally, we should stick to org- prefix, as expected
> from Elisp conventions. But we are already kind of breaking this
> convention by having all the oc- ol-, etc files.

I have decided that I prefer to have org-test common prefix even though 
it causes discrepancy test-ol.el file vs. test-org-link/... cases.

[-- Attachment #2: 0001-test-ol-Rename-cases-to-match-the-default-selector.patch --]
[-- Type: text/x-patch, Size: 5754 bytes --]

From 725369323a1a3303820c2c92b116e8238b895bac Mon Sep 17 00:00:00 2001
From: Max Nikulin <manikulin@gmail.com>
Date: Thu, 28 Jul 2022 22:08:57 +0700
Subject: [PATCH] test-ol: Rename cases to match the default selector

* testing/lisp/test-ol.el (test-ol/encode): Rename to
`test-org-link/encode'.
(test-ol/decode): Rename to `test-org-link/decode'.
(test-ol/encode-url-with-escaped-char): Rename to
`test-org-link/encode-url-with-escaped-char'.
(test-ol/org-toggle-link-display): Rename to
`test-org-link/toggle-link-display').
(test-ol/escape): Rename to `test-org-link/escape'.
(test-ol/unescape): Rename to `test-org-link/unescape'.
(test-ol/make-string): Rename to `test-org-link/make-string'.
(test-ol/store-link): Rename to `test-org-link/store-link'.
(test-ol/update-radio-target-regexp): Rename to
`test-org-link/update-radio-target-regexp'.
(test-ol/next-link): Rename to `test-org-link/next-link'.
(test-ol/previous-link): Rename to `test-org-link/previous-link'.
(test-ol/plain-link-re): Rename to `test-org-link/plain-link-re'.

Only `test-ol/org-toggle-link-display' was executed during
"make test" since it is the only name matched by the "org|ob" default
selector.  Reported in: Ihor Radchenko to emacs-orgmode.
Re [PATCH v7] ol.el: add description format parameter
to org-link-parameters.  Sun, 24 Jul 2022 21:15:31 +0800.
https://list.orgmode.org/87v8rmd53g.fsf@localhost/
---
 testing/lisp/test-ol.el | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/testing/lisp/test-ol.el b/testing/lisp/test-ol.el
index 429bb52ee..76881885d 100644
--- a/testing/lisp/test-ol.el
+++ b/testing/lisp/test-ol.el
@@ -22,7 +22,7 @@
 \f
 ;;; Decode and Encode Links
 
-(ert-deftest test-ol/encode ()
+(ert-deftest test-org-link/encode ()
   "Test `org-link-encode' specifications."
   ;; Regural test.
   (should (string= "Foo%3A%42ar" (org-link-encode "Foo:Bar" '(?\: ?\B))))
@@ -33,7 +33,7 @@
   ;; Encode a Unicode multibyte character.
   (should (string= "%E2%82%AC" (org-link-encode "€" '(?\€)))))
 
-(ert-deftest test-ol/decode ()
+(ert-deftest test-org-link/decode ()
   "Test `org-link-decode' specifications."
   ;; Decode an ASCII character.
   (should (string= "[" (org-link-decode "%5B")))
@@ -42,7 +42,7 @@
   ;; Decode a Unicode multibyte character.
   (should (string= "€" (org-link-decode "%E2%82%AC"))))
 
-(ert-deftest test-ol/encode-url-with-escaped-char ()
+(ert-deftest test-org-link/encode-url-with-escaped-char ()
   "Encode and decode a URL that includes an encoded char."
   (should
    (string= "http://some.host.com/form?&id=blah%2Bblah25"
@@ -50,7 +50,7 @@
 	     (org-link-encode "http://some.host.com/form?&id=blah%2Bblah25"
 			      '(?\s ?\[ ?\] ?%))))))
 
-(ert-deftest test-ol/org-toggle-link-display ()
+(ert-deftest test-org-link/toggle-link-display ()
   "Make sure that `org-toggle-link-display' is working.
 See https://github.com/yantar92/org/issues/4."
   (dolist (org-link-descriptive '(nil t))
@@ -77,7 +77,7 @@ See https://github.com/yantar92/org/issues/4."
 \f
 ;;; Escape and Unescape Links
 
-(ert-deftest test-ol/escape ()
+(ert-deftest test-org-link/escape ()
   "Test `org-link-escape' specifications."
   ;; No-op when there is no backslash or square bracket.
   (should (string= "foo" (org-link-escape "foo")))
@@ -101,7 +101,7 @@ See https://github.com/yantar92/org/issues/4."
   (should (string= "\\[\\[\\[foo\\]\\]\\]" (org-link-escape "[[[foo]]]")))
   (should (string= "\\[\\[foo\\]\\] bar" (org-link-escape "[[foo]] bar"))))
 
-(ert-deftest test-ol/unescape ()
+(ert-deftest test-org-link/unescape ()
   "Test `org-link-unescape' specifications."
   ;; No-op if there is no backslash.
   (should (string= "foo" (org-link-unescape "foo")))
@@ -122,7 +122,7 @@ See https://github.com/yantar92/org/issues/4."
   (should (string= "[[[foo]]]" (org-link-unescape "\\[\\[\\[foo\\]\\]\\]")))
   (should (string= "[[foo]] bar" (org-link-unescape "\\[\\[foo\\]\\] bar"))))
 
-(ert-deftest test-ol/make-string ()
+(ert-deftest test-org-link/make-string ()
   "Test `org-link-make-string' specifications."
   ;; Throw an error on empty URI.
   (should-error (org-link-make-string ""))
@@ -147,7 +147,7 @@ See https://github.com/yantar92/org/issues/4."
 \f
 ;;; Store links
 
-(ert-deftest test-ol/store-link ()
+(ert-deftest test-org-link/store-link ()
   "Test `org-store-link' specifications."
   ;; On a headline, link to that headline.  Use heading as the
   ;; description of the link.
@@ -380,7 +380,7 @@ See https://github.com/yantar92/org/issues/4."
 \f
 ;;; Radio Targets
 
-(ert-deftest test-ol/update-radio-target-regexp ()
+(ert-deftest test-org-link/update-radio-target-regexp ()
   "Test `org-update-radio-target-regexp' specifications."
   ;; Properly update cache with no previous radio target regexp.
   (should
@@ -414,7 +414,7 @@ See https://github.com/yantar92/org/issues/4."
 \f
 ;;; Navigation
 
-(ert-deftest test-ol/next-link ()
+(ert-deftest test-org-link/next-link ()
   "Test `org-next-link' specifications."
   ;; Move to any type of link.
   (should
@@ -465,7 +465,7 @@ See https://github.com/yantar92/org/issues/4."
 	    (org-next-link)
 	    (buffer-substring (point) (search-forward "]]" nil t))))))
 
-(ert-deftest test-ol/previous-link ()
+(ert-deftest test-org-link/previous-link ()
   "Test `org-previous-link' specifications."
   ;; Move to any type of link.
   (should
@@ -527,7 +527,7 @@ See https://github.com/yantar92/org/issues/4."
      (list (org-element-property :type (org-element-link-parser))
            (org-element-property :path (org-element-link-parser)))))
 
-(ert-deftest test-ol/plain-link-re ()
+(ert-deftest test-org-link/plain-link-re ()
   "Test `org-link-plain-re'."
   (should
    (equal
-- 
2.25.1


  reply	other threads:[~2022-07-28 15:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 15:27 [PATCH] org-test: Run all ol tests on make test Max Nikulin
2022-07-27  3:49 ` Ihor Radchenko
2022-07-27 15:43   ` Max Nikulin
2022-07-28 14:31     ` Ihor Radchenko
2022-07-28 15:14       ` Max Nikulin [this message]
2022-07-29 13:06         ` [PATCH v2] " 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='tbu94l$15gk$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).