[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] scratch/el-mock 84a743cfcb 40/64: Fix all compilation warnings
From: |
Stefan Monnier |
Subject: |
[nongnu] scratch/el-mock 84a743cfcb 40/64: Fix all compilation warnings |
Date: |
Mon, 28 Aug 2023 23:01:41 -0400 (EDT) |
branch: scratch/el-mock
commit 84a743cfcb9d5ed9c1b46f1bc20cdfc63df5eeff
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>
Fix all compilation warnings
---
el-mock.el | 4 ++--
test/el-mock-test.el | 41 +++++++++++++++++++++++++++--------------
2 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/el-mock.el b/el-mock.el
index acffc3760d..812cc12c3f 100644
--- a/el-mock.el
+++ b/el-mock.el
@@ -106,8 +106,8 @@
(when (fboundp funcsym)
(put funcsym 'mock-original-func (symbol-function funcsym)))
(fset funcsym
- `(lambda (&rest actual-args)
- (signal 'mock-error '(called))))))))
+ (lambda (&rest _actual-args)
+ (signal 'mock-error '(called))))))))
(defalias 'mock/teardown 'stub/teardown)
diff --git a/test/el-mock-test.el b/test/el-mock-test.el
index 1d4baaebb6..f71fa54d60 100644
--- a/test/el-mock-test.el
+++ b/test/el-mock-test.el
@@ -1,5 +1,22 @@
;; -*- lexical-binding: t; -*-
+(declare-function foo "el-mock-test")
+(declare-function foox "el-mock-test")
+(declare-function hogehoges "el-mock-test")
+(declare-function fooz "el-mock-test")
+(declare-function hoge "el-mock-test")
+(declare-function me "el-mock-test")
+(declare-function foom "el-mock-test")
+(declare-function bar "el-mock-test")
+(declare-function f "el-mock-test")
+(declare-function vi "el-mock-test")
+(declare-function test1 "el-mock-test")
+(declare-function defined-func "el-mock-test")
+(declare-function a "el-mock-test")
+(declare-function b "el-mock-test")
+(declare-function blah "el-mock-test")
+(declare-function fugaga "el-mock-test")
+
(expectations
(desc "stub setup/teardown")
(expect 2
@@ -62,7 +79,7 @@
(mock (bar 7) => 1)
(+ (foo 5) (bar 7))))
(expect 3
- (flet ((plus () (+ (foo 5) (bar 7))))
+ (cl-flet ((plus () (+ (foo 5) (bar 7))))
(with-mock
(mock (foo 5) => 2)
(mock (bar 7) => 1)
@@ -165,7 +182,7 @@
(mocklet ((foo => 2))
(foo 1 2 3)))
(expect 3
- (defun defined-func (x) 3)
+ (defun defined-func (_x) 3)
(prog1
(mocklet ((defined-func => 3))
(defined-func 3))
@@ -186,9 +203,8 @@
(expect "xxx"
(defun blah (x) (* x 2))
(prog1
- (let ((orig (symbol-function 'blah)))
- (mocklet ((blah => "xxx"))
- (blah "xx")))
+ (mocklet ((blah => "xxx"))
+ (blah "xx"))
(fmakunbound 'blah)))
(expect t
(defun blah (x) (* x 2))
@@ -207,9 +223,8 @@
(defadvice fugaga (around test activate)
(setq ad-return-value (concat "[" ad-return-value "]")))
(prog1
- (let ((orig (symbol-function 'fugaga)))
- (mocklet ((fugaga => "xxx"))
- (fugaga "aaaaa")))
+ (mocklet ((fugaga => "xxx"))
+ (fugaga "aaaaa"))
(fmakunbound 'fugaga)))))
(expect t
(mock-suppress-redefinition-message
@@ -232,9 +247,8 @@
(defadvice fugaga (around test activate)
(setq ad-return-value (concat "[" ad-return-value "]")))
(prog1
- (let ((orig (symbol-function 'fugaga)))
- (mocklet (((fugaga "aaaaa") => "xx"))
- (fugaga "aaaaa")))
+ (mocklet (((fugaga "aaaaa") => "xx"))
+ (fugaga "aaaaa"))
(fmakunbound 'fugaga)))))
(expect t
(mock-suppress-redefinition-message
@@ -275,9 +289,8 @@
(defadvice fugaga (around test activate)
(setq ad-return-value (concat "[" ad-return-value "]")))
(prog1
- (let ((orig (symbol-function 'fugaga)))
- (mocklet ((fugaga not-called))
- "not-called"))
+ (mocklet ((fugaga not-called))
+ "not-called")
(fmakunbound 'fugaga)))))
(expect t
(mock-suppress-redefinition-message
- [nongnu] scratch/el-mock 8cb59fc562 25/64: ©setup cask-package-toolset and update gitignore, (continued)
- [nongnu] scratch/el-mock 8cb59fc562 25/64: ©setup cask-package-toolset and update gitignore, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock a303e198a7 26/64: Setup coverage, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 8309faf0be 27/64: Add Continous Integration Badges, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 3aab4e3daf 29/64: Merge pull request #14 from phst/no-condition-case, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 034c7e5fca 30/64: Run tests on Travis in Emacs 25.1, Stefan Monnier, 2023/08/28
- [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 <=
- [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, 2023/08/28
- [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