Skip to content

Commit

Permalink
test: implement plistp
Browse files Browse the repository at this point in the history
  • Loading branch information
blahgeek committed Jan 3, 2024
1 parent e897c29 commit 29235c8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/benchmark_and_compare.template.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
(and (listp x)
(-all (lambda (e) (and (consp e) (symbolp (car e)))) x)))

(defun -plistp (x)
(and (listp x)
x
(keywordp (car x))))

(defun -sort-alist (x)
(sort x (lambda (a b) (string< (symbol-name (car a)) (symbol-name (car b))))))

Expand Down Expand Up @@ -60,8 +65,8 @@
(equal (length a) (length b))
(-check-equal-sorted-alist (-sort-alist a)
(-sort-alist b))))
((pred plistp)
(and (plistp b)
((pred -plistp) ;; plistp is not available before emacs29
(and (-plistp b)
(equal (length a) (length b))
(-check-equal-sorted-alist (-plist-to-sorted-alist a)
(-plist-to-sorted-alist b))))
Expand Down

0 comments on commit 29235c8

Please sign in to comment.