emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] scratch/el-mock 6f3da38bd3 45/64: Add a test for evaluating arg


From: Stefan Monnier
Subject: [nongnu] scratch/el-mock 6f3da38bd3 45/64: Add a test for evaluating arguments
Date: Mon, 28 Aug 2023 23:01:41 -0400 (EDT)

branch: scratch/el-mock
commit 6f3da38bd30b654cdd0bcbb2e98a93144ccee3c3
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>

    Add a test for evaluating arguments
---
 test/el-mock-test.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/test/el-mock-test.el b/test/el-mock-test.el
index f71fa54d60..16886b1eec 100644
--- a/test/el-mock-test.el
+++ b/test/el-mock-test.el
@@ -17,6 +17,8 @@
 (declare-function blah "el-mock-test")
 (declare-function fugaga "el-mock-test")
 
+(defvar el-mock-test-var)
+
 (expectations
  (desc "stub setup/teardown")
  (expect 2
@@ -104,6 +106,13 @@
          (with-mock
           (mock (me 1) => (+ 3 31))
           (me 1)))
+ (expect nil
+         (let ((el-mock-test-var 11))
+           (with-mock
+             (setq el-mock-test-var 22)
+             (mock (me el-mock-test-var)) ; not yet evaluated
+             (setq el-mock-test-var 33)
+             (me 33))))
 
  (desc "unfulfilled mock")
  (expect (error mock-error '((foom 5) (foom 6)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]