From: Damien Cassou Date: Tue, 7 Nov 2017 08:32:30 +0000 (+0100) Subject: Add a test to auth-source-pass-tests.el X-Git-Tag: emacs-27.0.90~4941 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b31e6de99d2c56ba61ea439b0b44862813d9480;p=emacs.git Add a test to auth-source-pass-tests.el * test/lisp/auth-source-pass-tests.el (auth-source-pass-build-result-passes-full-host-to-find-match): Add test making sure find-match is called with full host. --- diff --git a/test/lisp/auth-source-pass-tests.el b/test/lisp/auth-source-pass-tests.el index adb0b5d93fe..2ddbcab233c 100644 --- a/test/lisp/auth-source-pass-tests.el +++ b/test/lisp/auth-source-pass-tests.el @@ -204,6 +204,13 @@ This function is intended to be set to `auth-source-debug`." (should (equal (plist-get result :port) 512)) (should (equal (plist-get result :user) "anuser"))))) +(ert-deftest auth-source-pass-build-result-passes-full-host-to-find-match () + (let (passed-host) + (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"))))) + (ert-deftest auth-source-pass-only-return-entries-that-can-be-open () (cl-letf (((symbol-function 'auth-source-pass-entries) (lambda () '("foo.site.com" "bar.site.com" "mail/baz.site.com/scott")))