[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] scratch/el-mock e65ec012a7 44/64: Document that and when argume
From: |
Stefan Monnier |
Subject: |
[nongnu] scratch/el-mock e65ec012a7 44/64: Document that and when arguments and return values are evaluated |
Date: |
Mon, 28 Aug 2023 23:01:41 -0400 (EDT) |
branch: scratch/el-mock
commit e65ec012a724d0f2518e6601279a07e34716cc45
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>
Document that and when arguments and return values are evaluated
---
el-mock.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/el-mock.el b/el-mock.el
index 812cc12c3f..136d067df8 100644
--- a/el-mock.el
+++ b/el-mock.el
@@ -195,6 +195,7 @@ Synopsis:
* (stub FUNCTION => RETURN-VALUE)
Create a FUNCTION stub which returns RETURN-VALUE.
+RETURN-VALUE is evaluated when executing the mocked function.
Example:
(with-mock
@@ -231,6 +232,11 @@ Synopsis:
Wildcard:
The `*' is a special symbol: it accepts any value for that argument position.
+ARGS that are not `*' are evaluated when the mock is verified,
+i.e. upon leaving the enclosing `with-mock' form. ARGS are
+evaluated using dynamic scoping. The RETURN-VALUE is evaluated
+when executing the mocked function.
+
Example:
(with-mock
(mock (f * 2) => 3)
@@ -307,6 +313,11 @@ Spec is arguments of `mock', `not-called' or `stub'.
* (FUNCTION => RETURN-VALUE) ; stub which returns RETURN-VALUE
* (FUNCTION not-called) ; not-called FUNCTION
+ARGS that are not `*' are evaluated when the mock is verified,
+i.e. upon leaving the enclosing `with-mock' form. ARGS are
+evaluated using dynamic scoping. The RETURN-VALUE is evaluated
+when executing the mocked function.
+
Example:
(mocklet (((mock-nil 1))
((mock-1 *) => 1)
- [nongnu] scratch/el-mock 280e988956 33/64: Add more documentation to README.md, (continued)
- [nongnu] scratch/el-mock 280e988956 33/64: Add more documentation to README.md, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 68992d4361 35/64: Merge pull request #16 from phst/cl-lib, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock e3cff9f127 32/64: Merge pull request #13 from phst/fix-tests, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 136e0550e5 34/64: Migrate from obsolete cl.el to cl-lib, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 9e4d092179 38/64: Merge pull request #19 from ardumont/master, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 84a743cfcb 40/64: Fix all compilation warnings, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock b3accacee4 42/64: el-mock doesn’t need cl.el any more, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 6443c2aef4 46/64: Also run tests under Emacs 25.2, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 40a4e003e1 48/64: Add Github Actions, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 88038b382c 56/64: fix 80 character width warning seen here:, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock e65ec012a7 44/64: Document that and when arguments and return values are evaluated,
Stefan Monnier <=
- [nongnu] scratch/el-mock 6f3da38bd3 45/64: Add a test for evaluating arguments, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 2b4e3acc43 50/64: Merge pull request #29 from telotortium/github-actions, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock c05cc24df6 53/64: Merge pull request #30 from telotortium/fix-backtrace, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 21157530ca 59/64: Misc cosmetic changes, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 5b0afab8e9 60/64: * test/test-helper.el: Mark as not compiled, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 5fb2867d2e 36/64: Merge pull request #15 from gabrielmdeal/master, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 5084045989 37/64: Fix incf function symbol to cl-incf, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 9ddda16de4 39/64: Switch all Elisp files to lexical binding, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock e301749423 41/64: Merge pull request #21 from phst/compile-error, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 06fc9c4cac 43/64: Specify language of code blocks explicitly, Stefan Monnier, 2023/08/28