This repository has been archived on 2022-05-13. You can view files and clone it, but cannot push or open issues or pull requests.
chronometrist/tests/chronometrist-key-value-tests.el
contrapunctus bfddc66ff6 Rename chronometrist-sexp -> chronometrist-key-values
-sexp will be used for the current backend.
2020-05-14 07:32:49 +05:30

40 lines
1.5 KiB
EmacsLisp

(require 'buttercup)
(require 'chronometrist-key-values)
(describe
"chronometrist-plist-remove"
(it "works with one key"
(expect (chronometrist-plist-remove '(:a 1 :b 2 :c 3 :d 4)
:a)
:to-equal '(:b 2 :c 3 :d 4))
(expect (chronometrist-plist-remove '(:a 1 :b 2 :c 3 :d 4)
:b)
:to-equal '(:a 1 :c 3 :d 4))
(expect (chronometrist-plist-remove '(:a 1 :b 2 :c 3 :d 4)
:c)
:to-equal '(:a 1 :b 2 :d 4))
(expect (chronometrist-plist-remove '(:a 1 :b 2 :c 3 :d 4)
:d)
:to-equal '(:a 1 :b 2 :c 3)))
(it "works with multiple keys"
(expect (chronometrist-plist-remove '(:a 1 :b 2 :c 3 :d 4)
:a :b)
:to-equal '(:c 3 :d 4))
(expect (chronometrist-plist-remove '(:a 1 :b 2 :c 3 :d 4)
:a :d)
:to-equal '(:b 2 :c 3))
(expect (chronometrist-plist-remove '(:a 1 :b 2 :c 3 :d 4)
:c :d)
:to-equal '(:a 1 :b 2))
(expect (chronometrist-plist-remove '(:a 1 :b 2 :c 3 :d 4)
:a :b :c :d)
:to-equal nil))
(it "works with keys in any order"
(expect (chronometrist-plist-remove '(:a 1 :b 2 :c 3 :d 4)
:d :a)
:to-equal '(:b 2 :c 3))))
;; Local Variables:
;; nameless-current-name: "chronometrist"
;; End: