summaryrefslogtreecommitdiff
path: root/test/lisp/auth-source-pass-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/auth-source-pass-tests.el')
-rw-r--r--test/lisp/auth-source-pass-tests.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/auth-source-pass-tests.el b/test/lisp/auth-source-pass-tests.el
index ab9ef92c144..ae7a696bc66 100644
--- a/test/lisp/auth-source-pass-tests.el
+++ b/test/lisp/auth-source-pass-tests.el
@@ -186,6 +186,17 @@ This function is intended to be set to `auth-source-debug`."
(should (equal (auth-source-pass--find-match "host.com:8888" "someuser" nil)
"host.com"))))
+(ert-deftest auth-source-pass-find-host-with-port ()
+ (auth-source-pass--with-store '(("host.com:443"))
+ (should (equal (auth-source-pass--find-match "host.com" "someuser" "443")
+ "host.com:443"))))
+
+(ert-deftest auth-source-pass-find-host-with-custom-port-separator ()
+ (let ((auth-source-pass-port-separator "#"))
+ (auth-source-pass--with-store '(("host.com#443"))
+ (should (equal (auth-source-pass--find-match "host.com" "someuser" "443")
+ "host.com#443")))))
+
(defmacro auth-source-pass--with-store-find-foo (store &rest body)
"Use STORE while executing BODY. \"foo\" is the matched entry."
(declare (indent 1))