diff options
| author | Ted Zlatanov | 2017-08-18 18:44:58 -0400 |
|---|---|---|
| committer | Ted Zlatanov | 2017-08-18 18:46:19 -0400 |
| commit | 9ff5edc71373df398557f2fe45cc80099cc45317 (patch) | |
| tree | 524ab7d1370852ab65eb7c04981411f06a4ffe9d | |
| parent | 7098823b422c8334ef34664a9033b519f73ea7e1 (diff) | |
| download | emacs-9ff5edc71373df398557f2fe45cc80099cc45317.tar.gz emacs-9ff5edc71373df398557f2fe45cc80099cc45317.zip | |
* test/lisp/auth-source-tests.el: Minor cleanups to use CL.
| -rw-r--r-- | test/lisp/auth-source-tests.el | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/lisp/auth-source-tests.el b/test/lisp/auth-source-tests.el index eb56e94af2c..99d830c6b06 100644 --- a/test/lisp/auth-source-tests.el +++ b/test/lisp/auth-source-tests.el | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | ;;; Code: | 27 | ;;; Code: |
| 28 | 28 | ||
| 29 | (require 'ert) | 29 | (require 'ert) |
| 30 | (require 'cl) | ||
| 30 | (require 'auth-source) | 31 | (require 'auth-source) |
| 31 | 32 | ||
| 32 | (defvar secrets-enabled t | 33 | (defvar secrets-enabled t |
| @@ -266,20 +267,16 @@ | |||
| 266 | :host "b1" :port "b2" :user "b3") | 267 | :host "b1" :port "b2" :user "b3") |
| 267 | )) | 268 | )) |
| 268 | 269 | ||
| 269 | (text (string-join entries "\n")) | ||
| 270 | (netrc-file (make-temp-file | 270 | (netrc-file (make-temp-file |
| 271 | "auth-source-test" | 271 | "auth-source-test" |
| 272 | nil nil | 272 | nil nil |
| 273 | (string-join entries "\n"))) | 273 | (string-join entries "\n"))) |
| 274 | (auth-sources (list netrc-file)) | 274 | (auth-sources (list netrc-file)) |
| 275 | (auth-source-do-cache nil)) | 275 | (auth-source-do-cache nil) |
| 276 | found found-as-string) | ||
| 276 | 277 | ||
| 277 | (dolist (test tests) | 278 | (dolist (test tests) |
| 278 | (let ((testname (car test)) | 279 | (cl-destructuring-bind (testname needed &rest parameters) test |
| 279 | (needed (cadr test)) | ||
| 280 | (parameters (cddr test)) | ||
| 281 | found found-as-string) | ||
| 282 | |||
| 283 | (setq found (apply #'auth-source-search parameters)) | 280 | (setq found (apply #'auth-source-search parameters)) |
| 284 | (when (listp found) | 281 | (when (listp found) |
| 285 | (dolist (f found) | 282 | (dolist (f found) |