all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: phillip.lord@russet.org.uk (Phillip Lord)
To: Gemini Lasswell <gazally@runbox.com>
Cc: 24940@debbugs.gnu.org
Subject: bug#24940: [PATCH] Add should-call, should-not-call, and their tests
Date: Mon, 14 Nov 2016 16:18:22 +0000	[thread overview]
Message-ID: <87inrqxcfl.fsf@russet.org.uk> (raw)
In-Reply-To: <m2shqv58bz.fsf@rainbow.local> (Gemini Lasswell's message of "Sun, 13 Nov 2016 14:22:08 -0800")


That's interesting. I'm probably going to add my own package, assess, to
ELPA soon, and then to core, which has some similar functionality.

https://github.com/phillord/assess

Out of curiosity, would assess have fulfilled your use case also?

Gemini Lasswell <gazally@runbox.com> writes:
> In the process of writing tests for kmacro.el, I wrote two macros,
> should-call and should-not-call, that create context by temporarily
> adding advice to named functions. They allow a test writer to express
> expectations of how functions are used, to mock up responses of those
> functions to the code under test, and to prevent functions from running
> which might modify the global state of Emacs in an undesirable way
> during a test.
>
> I think that these macros would be useful additions to ERT. Here is a
> patch containing versions of the macros which are integrated into ERT
> and which provide better failure reporting than the ones that I included
> with the kmacro-tests.el patch in bug#24939.
>
> I also rewrote one test from files-tests.el as an example of usage and
> included it with the patch. It shows how the macros can help make the
> logic of a test clearer by removing the clutter of extra variables used
> to keep track of the arguments passed in function calls made by the code
> under test. For more examples, see the kmacro-tests.el patch in
> bug#24939.
>
> Let me know if you see ways to make this code better, or if there's any
> part of adding functionality to Emacs that I've missed here.





  parent reply	other threads:[~2016-11-14 16:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-13 22:22 bug#24940: [PATCH] Add should-call, should-not-call, and their tests Gemini Lasswell
2016-11-14 15:50 ` Eli Zaretskii
2016-11-15  5:52   ` Gemini Lasswell
2016-11-15 15:24     ` Eli Zaretskii
2020-08-11 13:23     ` Lars Ingebrigtsen
2016-11-14 16:18 ` Phillip Lord [this message]
2016-11-15  6:12   ` Gemini Lasswell
2019-06-24 23:43   ` Lars Ingebrigtsen

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=87inrqxcfl.fsf@russet.org.uk \
    --to=phillip.lord@russet.org.uk \
    --cc=24940@debbugs.gnu.org \
    --cc=gazally@runbox.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.