-;;; secrets-tests.el --- Tests of Secret Service API
+;;; secrets-tests.el --- Tests of Secret Service API -*- lexical-binding: t -*-
;; Copyright (C) 2018-2019 Free Software Foundation, Inc.
(require 'ert)
(require 'secrets)
+(require 'seq)
(require 'notifications)
;; We do not want chatty messages.
(dolist (item `("bar" ,item-path))
(should
(string-equal (secrets-get-attribute "session" item :method) "sudo"))
- ;; The attributes are collected in reverse order.
- ;; :xdg:schema is added silently.
+ ;; The attribute :xdg:schema is added silently.
(should
- (equal
+ (seq-set-equal-p
(secrets-get-attributes "session" item)
'((:xdg:schema . "org.freedesktop.Secret.Generic")
(:host . "remote-host") (:user . "joe") (:method . "sudo")))))
(secrets-search-items "session" :xdg:schema "org.gnu.Emacs.foo"))
(should
(equal
- (sort (secrets-search-items "session" :user "joe") 'string-lessp)
+ (sort (secrets-search-items "session" :user "joe") #'string-lessp)
'("baz" "foo")))
(should
(equal
(secrets-search-items "session":method "sudo" :user "joe") '("foo")))
(should
(equal
- (sort (secrets-search-items "session") 'string-lessp)
+ (sort (secrets-search-items "session") #'string-lessp)
'("bar" "baz" "foo"))))
;; Exit.
"Run all tests for \\[secrets]."
(interactive "p")
(funcall
- (if interactive 'ert-run-tests-interactively 'ert-run-tests-batch)
+ (if interactive #'ert-run-tests-interactively #'ert-run-tests-batch)
"^secrets"))
(provide 'secrets-tests)