mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Add tools/password-store unit test (#103)
This commit is contained in:
23
test/modules/tools/test-password-store.el
Normal file
23
test/modules/tools/test-password-store.el
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
;;; test/modules/feature/test-password-store.el
|
||||||
|
|
||||||
|
(require! :tools password-store t)
|
||||||
|
|
||||||
|
;;
|
||||||
|
(def-test-group! tools/password-store
|
||||||
|
(ert-deftest get-field ()
|
||||||
|
(let ((data `((secret . "defuse-account-gad")
|
||||||
|
("login" . "HL2532-GANDI")
|
||||||
|
("alt-login" . "hlissner")
|
||||||
|
("email" . "henrik@lissner.net")
|
||||||
|
("url" . "https://www.gandi.net/login"))))
|
||||||
|
(should (equal (+pass-get-field data "login")
|
||||||
|
"HL2532-GANDI"))
|
||||||
|
(should (equal (+pass-get-field data "email")
|
||||||
|
"henrik@lissner.net"))
|
||||||
|
(should (equal (+pass-get-field data '("alt-login" "email"))
|
||||||
|
"hlissner"))
|
||||||
|
(should (equal (+pass-get-field data '("username" "email"))
|
||||||
|
"henrik@lissner.net"))
|
||||||
|
(should-not (+pass-get-field data '("x" "y" "z"))))
|
||||||
|
|
||||||
|
(should-error (+pass-get-field nil nil))))
|
Reference in New Issue
Block a user