Coverage report: /home/ellis/comp/core/lib/cry/authinfo.lisp
Kind | Covered | All | % |
expression | 19 | 46 | 41.3 |
branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;; authinfo.lisp --- Gnus Authinfo
7
;; ref: https://www.emacswiki.org/emacs/GnusAuthinfo
10
(in-package :cry/authinfo)
12
(defvar *auth-sources* (list #p"~/.authinfo" #p"~/.authinfo.gpg"))
15
(defun write-authinfo-line (cons stream)
16
(write-string (car cons) stream)
17
(write-char #\space stream)
18
(write-line (cdr cons) stream))
20
(defun read-authinfo-line (stream)
21
(let ((line (read-line stream nil nil)))
26
((path :type pathname :initarg :path :accessor path)
27
(credentials :type list :initarg :credentials :accessor credentials)))
30
(defmethod serde ((from authinfo) (to pathname)))
31
(defmethod serde ((from stream) (to authinfo)))
33
(defmethod deserialize ((from pathname) (format (eql :authinfo)) &key)
34
(make-instance 'authinfo
37
(remove-if (lambda (x) (char= (char x 0) #\#)) (uiop:read-file-lines from))))
39
(defmethod deserialize ((from string) (format (eql :authinfo)) &key)
40
(make-instance 'authinfo
41
:credentials (remove-if (lambda (x) (char= (char x 0) #\#)) (split-sequence #\newline from))))