diff options
author | Tino Calancha <tino.calancha@gmail.com> | 2021-06-27 17:53:30 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-07-02 12:53:35 +0200 |
commit | 9eadcfdfe6f7b26ba44360db9f828fdbe7a78fe7 (patch) | |
tree | 802363ba30df135240fcfa6ced076923d6e5a21b /test/lisp/auth-source-pass-tests.el | |
parent | c3322729e4eb04539e2b6b9b06088e131c6a84f0 (diff) | |
download | emacs-9eadcfdfe6f7b26ba44360db9f828fdbe7a78fe7.tar.gz |
lisp/auth-source-pass.el: Keep legitimate spaces inside data
Users should be able to store a field as follows:
message: remember: Destroy the image and you will break the enemy
and later, recover the message untouched, i.e.:
"remember: Destroy the image and you will break the enemy"
* lisp/auth-source-pass.el (auth-source-pass--parse-data): Preserve
inner spaces at data.
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-parse-with-colons-in-data): Add test.
Diffstat (limited to 'test/lisp/auth-source-pass-tests.el')
-rw-r--r-- | test/lisp/auth-source-pass-tests.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lisp/auth-source-pass-tests.el b/test/lisp/auth-source-pass-tests.el index a2f84f20e8e..d050ac5b695 100644 --- a/test/lisp/auth-source-pass-tests.el +++ b/test/lisp/auth-source-pass-tests.el @@ -49,6 +49,12 @@ '(("key1" . "val1") ("key2" . "val2")))))) +(ert-deftest auth-source-pass-parse-with-colons-in-data () + (let ((content "pass\n--\nkey1 :val1\nkey2: please: keep my space after colon\n\n")) + (should (equal (auth-source-pass--parse-data content) + '(("key1" . "val1") + ("key2" . "please: keep my space after colon")))))) + (defvar auth-source-pass--debug-log nil "Contains a list of all messages passed to `auth-source-do-debug`.") |