-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.el
21 lines (20 loc) · 832 Bytes
/
test.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(require 'ert)
(add-to-list 'load-path
(file-name-directory (or #$ (expand-file-name (buffer-file-name)))))
(require 'keyctl)
(ert-deftest keyctl-test ()
(let* ((keyring (keyctl~new-keyring "test" KEY-SPEC-PROCESS-KEYRING))
(data (concat "hello world" (list 0 30)))
(key (keyctl~add-key "user" "foo" data keyring)))
(should (equal (keyctl~read key) data))
(aset data 1 ?a)
(should (keyctl~update-key key data))
(should (equal (keyctl~read key) data))
(should (equal (keyctl~list keyring) (list key)))
(print (keyctl~rdescribe key))
(print (keyctl~describe key))
(should-error (keyctl~list key))
(should (keyctl~unlink key keyring))
(should-error (keyctl~read key))
(should (keyctl~clear KEY-SPEC-PROCESS-KEYRING))
(should-error (keyctl~list keyring))))