]> git.eshelyaron.com Git - emacs.git/commitdiff
Add missing test cases to auth-source-pass-tests.el
authorDamien Cassou <damien@cassou.me>
Tue, 7 Nov 2017 08:48:50 +0000 (09:48 +0100)
committerNicolas Petton <nicolas@petton.fr>
Tue, 5 Jun 2018 13:51:09 +0000 (15:51 +0200)
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-build-result-passes-full-host-to-find-match): Add
missing test cases.

test/lisp/auth-source-pass-tests.el

index 2ddbcab233cc10182db57796e142ad753de87264..6d471f4e342e2caaee6c56dd9a30ae4255f5ef56 100644 (file)
@@ -209,7 +209,13 @@ This function is intended to be set to `auth-source-debug`."
     (cl-letf (((symbol-function 'auth-source-pass--find-match)
                (lambda (host _user) (setq passed-host host))))
       (auth-source-pass--build-result "https://user@host.com:123" nil nil)
-      (should (equal passed-host "https://user@host.com:123")))))
+      (should (equal passed-host "https://user@host.com:123"))
+      (auth-source-pass--build-result "https://user@host.com" nil nil)
+      (should (equal passed-host "https://user@host.com"))
+      (auth-source-pass--build-result "user@host.com" nil nil)
+      (should (equal passed-host "user@host.com"))
+      (auth-source-pass--build-result "user@host.com:443" nil nil)
+      (should (equal passed-host "user@host.com:443")))))
 
 (ert-deftest auth-source-pass-only-return-entries-that-can-be-open ()
   (cl-letf (((symbol-function 'auth-source-pass-entries)