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

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

[nongnu] scratch/el-mock 136e0550e5 34/64: Migrate from obsolete cl.el t


From: Stefan Monnier
Subject: [nongnu] scratch/el-mock 136e0550e5 34/64: Migrate from obsolete cl.el to cl-lib
Date: Mon, 28 Aug 2023 23:01:40 -0400 (EDT)

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

    Migrate from obsolete cl.el to cl-lib
---
 el-mock.el | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/el-mock.el b/el-mock.el
index ada4e7dc8b..47de237d56 100644
--- a/el-mock.el
+++ b/el-mock.el
@@ -58,7 +58,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))
+(require 'cl-lib)
 (require 'advice)
 
 (defvar -stubbed-functions nil)
@@ -115,24 +115,24 @@
 (put 'mock-error 'error-conditions '(mock-error error))
 (put 'mock-error 'error-message "Mock error")
 (defun mock-verify ()
-  (loop for f in -mocked-functions
-        when (equal 0 (get f 'mock-call-count))
-        do (signal 'mock-error (list 'not-called f)))
-  (loop for args in mock-verify-list
-        do
-        (apply 'mock-verify-args args)))
+  (cl-loop for f in -mocked-functions
+           when (equal 0 (get f 'mock-call-count))
+           do (signal 'mock-error (list 'not-called f)))
+  (cl-loop for args in mock-verify-list
+           do
+           (apply 'mock-verify-args args)))
 
 (defun mock-verify-args (funcsym expected-args actual-args expected-times)
   (unless (= (length expected-args) (length actual-args))
     (signal 'mock-error (list (cons funcsym expected-args)
                               (cons funcsym actual-args))))
-  (loop for e in expected-args
-        for a in actual-args
-        do
-        (unless (eq e '*)               ; `*' is wildcard argument
-          (unless (equal (eval e) a)
-            (signal 'mock-error (list (cons funcsym expected-args)
-                                      (cons funcsym actual-args))))))
+  (cl-loop for e in expected-args
+           for a in actual-args
+           do
+           (unless (eq e '*)               ; `*' is wildcard argument
+             (unless (equal (eval e) a)
+               (signal 'mock-error (list (cons funcsym expected-args)
+                                         (cons funcsym actual-args))))))
   (let ((actual-times (or (get funcsym 'mock-call-count) 0)))
     (and expected-times (/= expected-times actual-times)
          (signal 'mock-error (list (cons funcsym expected-args)



reply via email to

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