1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-31 20:02:42 +00:00

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.
This commit is contained in:
Stefan Monnier 2017-12-27 18:42:01 -05:00
parent fb619c1c22
commit b19df8ae78
2 changed files with 15 additions and 17 deletions

View File

@ -26,8 +26,6 @@
;;; Code:
;; registry.el is required by gnus-registry.el but this way we're explicit.
(eval-when-compile (require 'cl))
(require 'registry)
(require 'gnus-registry)

View File

@ -26,7 +26,7 @@
;;; Code:
(require 'ert)
(require 'cl)
(require 'cl-lib)
(require 'gnutls)
(require 'hex-util)
@ -46,22 +46,22 @@
(defvar gnutls-tests-tested-macs
(when (gnutls-available-p)
(remove-duplicates
(append (mapcar 'cdr gnutls-tests-internal-macs-upcased)
(mapcar 'car (gnutls-macs))))))
(cl-remove-duplicates
(append (mapcar #'cdr gnutls-tests-internal-macs-upcased)
(mapcar #'car (gnutls-macs))))))
(defvar gnutls-tests-tested-digests
(when (gnutls-available-p)
(remove-duplicates
(append (mapcar 'cdr gnutls-tests-internal-macs-upcased)
(mapcar 'car (gnutls-digests))))))
(cl-remove-duplicates
(append (mapcar #'cdr gnutls-tests-internal-macs-upcased)
(mapcar #'car (gnutls-digests))))))
(defvar gnutls-tests-tested-ciphers
(when (gnutls-available-p)
(remove-duplicates
; these cause FPEs or SEGVs
(remove-if (lambda (e) (memq e '(ARCFOUR-128)))
(mapcar 'car (gnutls-ciphers))))))
(cl-remove-duplicates
;; these cause FPEs or SEGVs
(cl-remove-if (lambda (e) (memq e '(ARCFOUR-128)))
(mapcar #'car (gnutls-ciphers))))))
(defvar gnutls-tests-mondo-strings
(list
@ -154,7 +154,7 @@
("0cc175b9c0f1b6a831c399e269772661" "a" MD5)
("a9993e364706816aba3e25717850c26c9cd0d89d" "abc" SHA1)
("a9993e364706816aba3e25717850c26c9cd0d89d" "abc" "SHA1"))) ; check string ID for digest
(destructuring-bind (hash input mac) test
(pcase-let ((`(,hash ,input ,mac) test))
(let ((plist (cdr (assq mac macs)))
result resultb)
(gnutls-tests-message "%s %S" mac plist)
@ -178,7 +178,7 @@
("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)
("4bc830005783a73b8112f4bd5f4aa5f92e05b51e9b55c0cd6f9a7bee48371def" "more and more data goes into a file to exceed the buffer size" "" "SHA256") ; check string ID for HMAC
("4bc830005783a73b8112f4bd5f4aa5f92e05b51e9b55c0cd6f9a7bee48371def" "more and more data goes into a file to exceed the buffer size" "" SHA256)))
(destructuring-bind (hash input key mac) test
(pcase-let ((`(,hash ,input ,key ,mac) test))
(let ((plist (cdr (assq mac macs)))
result)
(gnutls-tests-message "%s %S" mac plist)
@ -214,7 +214,7 @@
(let ((keys '("mykey" "mykey2"))
(inputs gnutls-tests-mondo-strings)
(ivs '("" "-abc123-" "init" "ini2"))
(ciphers (remove-if
(ciphers (cl-remove-if
(lambda (c) (plist-get (cdr (assq c (gnutls-ciphers)))
:cipher-aead-capable))
gnutls-tests-tested-ciphers)))
@ -252,7 +252,7 @@
"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 "
"AUTH data and more data to go over the block limit!"
"AUTH data and more data to go over the block limit"))
(ciphers (remove-if
(ciphers (cl-remove-if
(lambda (c) (or (null (plist-get (cdr (assq c (gnutls-ciphers)))
:cipher-aead-capable))))
gnutls-tests-tested-ciphers))