diff options
author | Magnus Henoch <magnus.henoch@gmail.com> | 2018-11-02 21:51:59 +0000 |
---|---|---|
committer | Damien Cassou <damien@cassou.me> | 2019-06-24 09:15:39 +0200 |
commit | 527efaf798ad73878f6df03f5af9d9b0ba517b9d (patch) | |
tree | 7739ede9d206290bab1cb19c448634aecfe71175 /test/lisp/auth-source-pass-tests.el | |
parent | b9ac4f815ebaa1acb0d045fe9583f665efa6f628 (diff) | |
download | emacs-527efaf798ad73878f6df03f5af9d9b0ba517b9d.tar.gz |
Fix auth-source-pass to return nil if no entry found
* lisp/auth-source-pass.el (auth-source-pass-search): If there is no
matching entry, auth-source-pass-search should return nil, not (nil).
This lets auth-source fall back to other backends in the auth-sources
list.
* test/lisp/auth-source-pass-tests.el: Add corresponding test.
Copyright-paperwork-exempt: yes
Diffstat (limited to 'test/lisp/auth-source-pass-tests.el')
-rw-r--r-- | test/lisp/auth-source-pass-tests.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/lisp/auth-source-pass-tests.el b/test/lisp/auth-source-pass-tests.el index d1e486ad6be..ab9ef92c144 100644 --- a/test/lisp/auth-source-pass-tests.el +++ b/test/lisp/auth-source-pass-tests.el @@ -83,6 +83,11 @@ This function is intended to be set to `auth-source-debug`." ("bar")) (should-not (auth-source-pass-search :host nil)))) +(ert-deftest auth-source-pass-not-found () + (auth-source-pass--with-store '(("foo" ("port" . "foo-port") ("host" . "foo-user")) + ("bar")) + (should-not (auth-source-pass-search :host "baz")))) + (ert-deftest auth-source-pass-find-match-matching-at-entry-name () (auth-source-pass--with-store '(("foo")) |