From: Ihor Radchenko <yantar92@gmail.com>
To: Maxim Nikulin <manikulin@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: [PATCH] Re: Bug: Plain https links with brackets are not recognised [9.4.4 (release_9.4.4-625-g763c7a @ /home/yantar92/.emacs.d/straight/build/org/)]
Date: Fri, 19 Mar 2021 23:40:27 +0800 [thread overview]
Message-ID: <877dm35ez8.fsf@localhost> (raw)
In-Reply-To: <s324b0$74g$1@ciao.gmane.io>
Maxim Nikulin <manikulin@gmail.com> writes:
> To be clear, I do not ask for any changes. It is great to have some
> tests even in the current form. I just have never tried ert before, so I
> have some questions.
Note that I have no experience with tests since I never did programming
professionally. I wrote the tests in the patch simply by looking at
other examples in the file.
> Am I right that just one failure will be reported if a change in the
> regexp causes problems with several test inputs? I am afraid, it is
> rather inconvenient since this tests are rather for quality of
> heuristics than exact requirements. To find proper balance of accuracy
> and speed/regexp complexity, it is better to have all failures at once.
> I am looking up for a feature like EXPECT_EQ (delayed failure) in
> addition to strict ASSERT_EQ in googletest or at least like
> TestCase.subTest in puthon unittest. For this particular case even
> parametrized tests are enough (googletest, pytest).
I cannot find anything like delayed failure in the info node for ERT and
in the source code. There are should, should-not, should-error, and
skip-unless asserts.
> I have tried implement something similar to illustrate my expectations.
> I think, for experienced lisp programmers the code looks ugly
Using a macro is certainly more efficient than my copy-paste in the
patch :) Though you may probably use more backquoting (see Backquote in
Elisp manual) when writing macros. That would look more readable.
> I do not know if it is possible to implement "might" (in addition to
> "should") that using restart or some other technique will prevent
> immediate abandoning of the test but will mark whole test as failed at
> the end.
It is indeed possible and maybe even welcome in emacs-devel.
> Actually I hope to get response that I am trying to reinvent a wheel and
> org or emacs has an established way to write tests feeding the same
> function with list of cases
Well... Example from ERT info page:
(ert-deftest ert-test-mismatch ()
(should (eql (cl-mismatch "" "") nil))
(should (eql (cl-mismatch "" "a") 0))
(should (eql (cl-mismatch "a" "a") nil))
(should (eql (cl-mismatch "ab" "a") 1))
(should (eql (cl-mismatch "Aa" "aA") 0))
(should (eql (cl-mismatch '(a b c) '(a b d)) 2)))
> ... and to get all failures in a reasonably readable report.
When running ert interactively, things should get a little more
manageable. See Running Tests Interactively node of ERT manual.
Hope it helps.
Best,
Ihor
next prev parent reply other threads:[~2021-03-19 15:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-13 2:56 Bug: Plain https links with brackets are not recognised [9.4.4 (release_9.4.4-625-g763c7a @ /home/yantar92/.emacs.d/straight/build/org/)] Ihor Radchenko
2021-03-13 3:23 ` Kyle Meyer
2021-03-13 5:21 ` [PATCH] " Ihor Radchenko
2021-03-13 5:24 ` Ihor Radchenko
2021-03-15 11:54 ` Maxim Nikulin
2021-03-16 12:35 ` Ihor Radchenko
2021-03-17 14:59 ` Maxim Nikulin
2021-03-19 15:07 ` Ihor Radchenko
2021-03-24 12:31 ` Maxim Nikulin
2021-03-24 14:11 ` Ihor Radchenko
2021-03-19 12:10 ` Maxim Nikulin
2021-03-19 15:40 ` Ihor Radchenko [this message]
2021-03-24 12:51 ` Nicolas Goaziou
2021-03-24 13:10 ` Ihor Radchenko
2021-03-24 14:13 ` Ihor Radchenko
2021-05-15 8:34 ` Bastien
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877dm35ez8.fsf@localhost \
--to=yantar92@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=manikulin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.