GNU bug report logs -
#24940
[PATCH] Add should-call, should-not-call, and their tests
Previous Next
Reported by: Gemini Lasswell <gazally <at> runbox.com>
Date: Sun, 13 Nov 2016 22:23:01 UTC
Severity: wishlist
Tags: moreinfo, patch
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 24940 <at> debbugs.gnu.org (full text, mbox):
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 <at> 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.
This bug report was last modified 5 years and 7 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.