aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/auth-source-tests.el28
1 files changed, 18 insertions, 10 deletions
diff --git a/test/lisp/auth-source-tests.el b/test/lisp/auth-source-tests.el
index 5452501b861..2ff76977174 100644
--- a/test/lisp/auth-source-tests.el
+++ b/test/lisp/auth-source-tests.el
@@ -442,18 +442,26 @@ machine c1 port c2 user c3 password c4\n"
442 (cl-letf (((symbol-function 'call-process) 442 (cl-letf (((symbol-function 'call-process)
443 (lambda (_program _infile _destination _display 443 (lambda (_program _infile _destination _display
444 &rest args) 444 &rest args)
445 ;; Arguments must be all strings 445 ;; Arguments must be all strings.
446 (should (cl-every #'stringp args)) 446 (should (cl-every #'stringp args))
447 ;; Argument number should be even 447 ;; Argument number should be even.
448 (should (cl-evenp (length args))) 448 (should (cl-evenp (length args)))
449 (should (cond ((string= (car args) "find-internet-password") 449 (should
450 (let ((protocol (cl-member "-r" args :test #'string=))) 450 (cond
451 (if protocol 451 ((string= (car args) "find-internet-password")
452 (= 4 (length (cadr protocol))) 452 (let ((protocol-r (cl-member "-r" args :test #'string=))
453 t))) 453 (protocol-P (cl-member "-P" args :test #'string=)))
454 ((string= (car args) "find-generic-password") 454 (cond (protocol-r
455 t)))))) 455 (= 4 (length (cadr protocol-r))))
456 (auth-source-search :user '("a" "b") :host '("example.org") :port '("irc" "ftp" "https"))))) 456 (protocol-P
457 (string-match-p
458 "\\`[[:digit:]]+\\'" (cadr protocol-P)))
459 (t))))
460 ((string= (car args) "find-generic-password")
461 t))))))
462 (auth-source-search
463 :user '("a" "b") :host '("example.org")
464 :port '("irc" "ftp" "https" 123)))))
457 465
458(provide 'auth-source-tests) 466(provide 'auth-source-tests)
459;;; auth-source-tests.el ends here 467;;; auth-source-tests.el ends here