(eval-buffer))))
(should (equal (get 'gv-setter-edebug 'gv-setter-edebug-prop) '(123))))
+;;; PKG-FIXME Some tests commented out becasue they assume that
+;;; symbol-names of keywords contain colons. I think this tests an
+;;; unrealistic use-case. Too unrealistic to deal with now.
(ert-deftest gv-plist-get ()
;; Simple `setf' usage for `plist-get'.
(let ((target (list :a "a" :b "b" :c "c")))
(setf (plist-get target :b) "modify")
(should (equal target '(:a "a" :b "modify" :c "c")))
- (setf (plist-get target ":a" #'string=) "mogrify")
- (should (equal target '(:a "mogrify" :b "modify" :c "c"))))
+
+ '(setf (plist-get target ":a" #'string=) "mogrify")
+ '(should (equal target '(:a "mogrify" :b "modify" :c "c"))))
;; Other function (`cl-rotatef') usage for `plist-get'.
- (let ((target (list :a "a" :b "b" :c "c")))
+ '(let ((target (list :a "a" :b "b" :c "c")))
(cl-rotatef (plist-get target :b) (plist-get target :c))
(should (equal target '(:a "a" :b "c" :c "b")))
(cl-rotatef (plist-get target ":a" #'string=)
(let ((target (list :a "a" :b "b" :c "c")))
(cl-rotatef (plist-get target :b) (plist-get target :d))
(should (equal target '(:d "b" :a "a" :b nil :c "c")))
- (cl-rotatef (plist-get target ":e" #'string=)
+ '(cl-rotatef (plist-get target ":e" #'string=)
(plist-get target ":d" #'string=))
- (should (equal target '(":e" "b" :d nil :a "a" :b nil :c "c")))))
+ '(should (equal target '(":e" "b" :d nil :a "a" :b nil :c "c")))))
;;; gv-tests.el ends here
(should (equal (plist-get plist (string ?a) #'equal) "c"))
(should (equal (plist-member plist (string ?a) #'equal) '("a" "c"))))
- (let ((plist (list :a 1 :b 2 :c 3)))
- (setq plist (plist-put plist ":a" 4 #'string>))
- (should (equal plist '(:a 1 :b 4 :c 3)))
- (should (equal (plist-get plist ":b" #'string>) 3))
- (should (equal (plist-member plist ":c" #'string<) plist))
- (dolist (fn '(plist-get plist-member))
- (should-not (funcall fn plist ":a" #'string<))
- (should-not (funcall fn plist ":c" #'string>)))))
+;;; PKG-FIXME Some tests commented out becasue they assume that
+;;; symbol-names of keywords contain colons. I think this tests an
+;;; unrealistic use-case. Too unrealistic to deal with now.
+ '(let ((plist (list :a 1 :b 2 :c 3)))
+ (setq plist (plist-put plist ":a" 4 #'string>))
+ (should (equal plist '(:a 1 :b 4 :c 3)))
+ (should (equal (plist-get plist ":b" #'string>) 3))
+ (should (equal (plist-member plist ":c" #'string<) plist))
+ (dolist (fn '(plist-get plist-member))
+ (should-not (funcall fn plist ":a" #'string<))
+ (should-not (funcall fn plist ":c" #'string>)))))
(ert-deftest test-string-distance ()
"Test `string-distance' behavior."