aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBasil L. Contovounesios2019-07-16 17:41:18 +0100
committerBasil L. Contovounesios2019-07-16 18:29:52 +0100
commitd2758820cd45733570c704431da3f3e91dbb8605 (patch)
treeb7ded792c1770ce947c0bc31139df2b9ae023b52
parenta87840fffbf471d53eba17ea683728125d2d4767 (diff)
downloademacs-d2758820cd45733570c704431da3f3e91dbb8605.tar.gz
emacs-d2758820cd45733570c704431da3f3e91dbb8605.zip
Fix failing secrets-test03-items
* test/lisp/net/secrets-tests.el: Use lexical-binding. (secrets-test03-items): Do not assume :xdg:schema attribute is silently added to the front of the collection (bug#36694). (secrets-test04-search, secrets-test-all): Quote function symbols as such.
-rw-r--r--test/lisp/net/secrets-tests.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/lisp/net/secrets-tests.el b/test/lisp/net/secrets-tests.el
index c565eba5679..bab8eb5d188 100644
--- a/test/lisp/net/secrets-tests.el
+++ b/test/lisp/net/secrets-tests.el
@@ -1,4 +1,4 @@
1;;; secrets-tests.el --- Tests of Secret Service API 1;;; secrets-tests.el --- Tests of Secret Service API -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 2018-2019 Free Software Foundation, Inc. 3;; Copyright (C) 2018-2019 Free Software Foundation, Inc.
4 4
@@ -21,6 +21,7 @@
21 21
22(require 'ert) 22(require 'ert)
23(require 'secrets) 23(require 'secrets)
24(require 'seq)
24(require 'notifications) 25(require 'notifications)
25 26
26;; We do not want chatty messages. 27;; We do not want chatty messages.
@@ -175,10 +176,9 @@
175 (dolist (item `("bar" ,item-path)) 176 (dolist (item `("bar" ,item-path))
176 (should 177 (should
177 (string-equal (secrets-get-attribute "session" item :method) "sudo")) 178 (string-equal (secrets-get-attribute "session" item :method) "sudo"))
178 ;; The attributes are collected in reverse order. 179 ;; The attribute :xdg:schema is added silently.
179 ;; :xdg:schema is added silently.
180 (should 180 (should
181 (equal 181 (seq-set-equal-p
182 (secrets-get-attributes "session" item) 182 (secrets-get-attributes "session" item)
183 '((:xdg:schema . "org.freedesktop.Secret.Generic") 183 '((:xdg:schema . "org.freedesktop.Secret.Generic")
184 (:host . "remote-host") (:user . "joe") (:method . "sudo"))))) 184 (:host . "remote-host") (:user . "joe") (:method . "sudo")))))
@@ -242,14 +242,14 @@
242 (secrets-search-items "session" :xdg:schema "org.gnu.Emacs.foo")) 242 (secrets-search-items "session" :xdg:schema "org.gnu.Emacs.foo"))
243 (should 243 (should
244 (equal 244 (equal
245 (sort (secrets-search-items "session" :user "joe") 'string-lessp) 245 (sort (secrets-search-items "session" :user "joe") #'string-lessp)
246 '("baz" "foo"))) 246 '("baz" "foo")))
247 (should 247 (should
248 (equal 248 (equal
249 (secrets-search-items "session":method "sudo" :user "joe") '("foo"))) 249 (secrets-search-items "session":method "sudo" :user "joe") '("foo")))
250 (should 250 (should
251 (equal 251 (equal
252 (sort (secrets-search-items "session") 'string-lessp) 252 (sort (secrets-search-items "session") #'string-lessp)
253 '("bar" "baz" "foo")))) 253 '("bar" "baz" "foo"))))
254 254
255 ;; Exit. 255 ;; Exit.
@@ -261,7 +261,7 @@
261 "Run all tests for \\[secrets]." 261 "Run all tests for \\[secrets]."
262 (interactive "p") 262 (interactive "p")
263 (funcall 263 (funcall
264 (if interactive 'ert-run-tests-interactively 'ert-run-tests-batch) 264 (if interactive #'ert-run-tests-interactively #'ert-run-tests-batch)
265 "^secrets")) 265 "^secrets"))
266 266
267(provide 'secrets-tests) 267(provide 'secrets-tests)