aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2017-12-27 18:42:01 -0500
committerStefan Monnier2017-12-27 18:42:01 -0500
commitb19df8ae78cdebe76512a70f76ec68677de41c11 (patch)
treecce4e38357a4464957f6b50e07ef8ce56a686f5b
parentfb619c1c22b986841964b09b7effe42785f3fed8 (diff)
downloademacs-b19df8ae78cdebe76512a70f76ec68677de41c11.tar.gz
emacs-b19df8ae78cdebe76512a70f76ec68677de41c11.zip
Remove uses of `cl` from test/ subdirectory
* test/lisp/gnus/gnus-tests.el: Remove unneeded (require 'cl). * test/lisp/net/gnutls-tests.el: Use cl-lib and pcase.
-rw-r--r--test/lisp/gnus/gnus-tests.el2
-rw-r--r--test/lisp/net/gnutls-tests.el30
2 files changed, 15 insertions, 17 deletions
diff --git a/test/lisp/gnus/gnus-tests.el b/test/lisp/gnus/gnus-tests.el
index c2a41d717cf..18a445dff35 100644
--- a/test/lisp/gnus/gnus-tests.el
+++ b/test/lisp/gnus/gnus-tests.el
@@ -26,8 +26,6 @@
26 26
27;;; Code: 27;;; Code:
28;; registry.el is required by gnus-registry.el but this way we're explicit. 28;; registry.el is required by gnus-registry.el but this way we're explicit.
29(eval-when-compile (require 'cl))
30
31(require 'registry) 29(require 'registry)
32(require 'gnus-registry) 30(require 'gnus-registry)
33 31
diff --git a/test/lisp/net/gnutls-tests.el b/test/lisp/net/gnutls-tests.el
index fd0b5decb8c..4636a9a5c84 100644
--- a/test/lisp/net/gnutls-tests.el
+++ b/test/lisp/net/gnutls-tests.el
@@ -26,7 +26,7 @@
26;;; Code: 26;;; Code:
27 27
28(require 'ert) 28(require 'ert)
29(require 'cl) 29(require 'cl-lib)
30(require 'gnutls) 30(require 'gnutls)
31(require 'hex-util) 31(require 'hex-util)
32 32
@@ -46,22 +46,22 @@
46 46
47(defvar gnutls-tests-tested-macs 47(defvar gnutls-tests-tested-macs
48 (when (gnutls-available-p) 48 (when (gnutls-available-p)
49 (remove-duplicates 49 (cl-remove-duplicates
50 (append (mapcar 'cdr gnutls-tests-internal-macs-upcased) 50 (append (mapcar #'cdr gnutls-tests-internal-macs-upcased)
51 (mapcar 'car (gnutls-macs)))))) 51 (mapcar #'car (gnutls-macs))))))
52 52
53(defvar gnutls-tests-tested-digests 53(defvar gnutls-tests-tested-digests
54 (when (gnutls-available-p) 54 (when (gnutls-available-p)
55 (remove-duplicates 55 (cl-remove-duplicates
56 (append (mapcar 'cdr gnutls-tests-internal-macs-upcased) 56 (append (mapcar #'cdr gnutls-tests-internal-macs-upcased)
57 (mapcar 'car (gnutls-digests)))))) 57 (mapcar #'car (gnutls-digests))))))
58 58
59(defvar gnutls-tests-tested-ciphers 59(defvar gnutls-tests-tested-ciphers
60 (when (gnutls-available-p) 60 (when (gnutls-available-p)
61 (remove-duplicates 61 (cl-remove-duplicates
62 ; these cause FPEs or SEGVs 62 ;; these cause FPEs or SEGVs
63 (remove-if (lambda (e) (memq e '(ARCFOUR-128))) 63 (cl-remove-if (lambda (e) (memq e '(ARCFOUR-128)))
64 (mapcar 'car (gnutls-ciphers)))))) 64 (mapcar #'car (gnutls-ciphers))))))
65 65
66(defvar gnutls-tests-mondo-strings 66(defvar gnutls-tests-mondo-strings
67 (list 67 (list
@@ -154,7 +154,7 @@
154 ("0cc175b9c0f1b6a831c399e269772661" "a" MD5) 154 ("0cc175b9c0f1b6a831c399e269772661" "a" MD5)
155 ("a9993e364706816aba3e25717850c26c9cd0d89d" "abc" SHA1) 155 ("a9993e364706816aba3e25717850c26c9cd0d89d" "abc" SHA1)
156 ("a9993e364706816aba3e25717850c26c9cd0d89d" "abc" "SHA1"))) ; check string ID for digest 156 ("a9993e364706816aba3e25717850c26c9cd0d89d" "abc" "SHA1"))) ; check string ID for digest
157 (destructuring-bind (hash input mac) test 157 (pcase-let ((`(,hash ,input ,mac) test))
158 (let ((plist (cdr (assq mac macs))) 158 (let ((plist (cdr (assq mac macs)))
159 result resultb) 159 result resultb)
160 (gnutls-tests-message "%s %S" mac plist) 160 (gnutls-tests-message "%s %S" mac plist)
@@ -178,7 +178,7 @@
178 ("81568ba71fa2c5f33cc84bf362466988f98eba3735479100b4e8908acad87ac4" "more and more data goes into a file to exceed the buffer size" "very long key goes here to exceed the key size" SHA256) 178 ("81568ba71fa2c5f33cc84bf362466988f98eba3735479100b4e8908acad87ac4" "more and more data goes into a file to exceed the buffer size" "very long key goes here to exceed the key size" SHA256)
179 ("4bc830005783a73b8112f4bd5f4aa5f92e05b51e9b55c0cd6f9a7bee48371def" "more and more data goes into a file to exceed the buffer size" "" "SHA256") ; check string ID for HMAC 179 ("4bc830005783a73b8112f4bd5f4aa5f92e05b51e9b55c0cd6f9a7bee48371def" "more and more data goes into a file to exceed the buffer size" "" "SHA256") ; check string ID for HMAC
180 ("4bc830005783a73b8112f4bd5f4aa5f92e05b51e9b55c0cd6f9a7bee48371def" "more and more data goes into a file to exceed the buffer size" "" SHA256))) 180 ("4bc830005783a73b8112f4bd5f4aa5f92e05b51e9b55c0cd6f9a7bee48371def" "more and more data goes into a file to exceed the buffer size" "" SHA256)))
181 (destructuring-bind (hash input key mac) test 181 (pcase-let ((`(,hash ,input ,key ,mac) test))
182 (let ((plist (cdr (assq mac macs))) 182 (let ((plist (cdr (assq mac macs)))
183 result) 183 result)
184 (gnutls-tests-message "%s %S" mac plist) 184 (gnutls-tests-message "%s %S" mac plist)
@@ -214,7 +214,7 @@
214 (let ((keys '("mykey" "mykey2")) 214 (let ((keys '("mykey" "mykey2"))
215 (inputs gnutls-tests-mondo-strings) 215 (inputs gnutls-tests-mondo-strings)
216 (ivs '("" "-abc123-" "init" "ini2")) 216 (ivs '("" "-abc123-" "init" "ini2"))
217 (ciphers (remove-if 217 (ciphers (cl-remove-if
218 (lambda (c) (plist-get (cdr (assq c (gnutls-ciphers))) 218 (lambda (c) (plist-get (cdr (assq c (gnutls-ciphers)))
219 :cipher-aead-capable)) 219 :cipher-aead-capable))
220 gnutls-tests-tested-ciphers))) 220 gnutls-tests-tested-ciphers)))
@@ -252,7 +252,7 @@
252 "auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data " 252 "auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data auth and auth of data "
253 "AUTH data and more data to go over the block limit!" 253 "AUTH data and more data to go over the block limit!"
254 "AUTH data and more data to go over the block limit")) 254 "AUTH data and more data to go over the block limit"))
255 (ciphers (remove-if 255 (ciphers (cl-remove-if
256 (lambda (c) (or (null (plist-get (cdr (assq c (gnutls-ciphers))) 256 (lambda (c) (or (null (plist-get (cdr (assq c (gnutls-ciphers)))
257 :cipher-aead-capable)))) 257 :cipher-aead-capable))))
258 gnutls-tests-tested-ciphers)) 258 gnutls-tests-tested-ciphers))