X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fregistry.el;h=b2130d56eb603de626a947fa17d00d5d7381164f;hb=e2c1d571d8a1c38be0eab90ac59fe3a916ffa62d;hp=8079195b7c238ff22d3e1fc4f9d8ebc0a690128e;hpb=c1079f4741f9f8ee36a254d5867f3d4b3bc01c4b;p=gnus diff --git a/lisp/registry.el b/lisp/registry.el index 8079195b7..b2130d56e 100644 --- a/lisp/registry.el +++ b/lisp/registry.el @@ -367,42 +367,5 @@ Proposes any entries over the max-hard limit minus size * prune-factor." collect k))) (list limit candidates)))) -(ert-deftest registry-instantiation-test () - (should (registry-db "Testing"))) - -(ert-deftest registry-match-test () - (let ((entry '((hello "goodbye" "bye") (blank)))) - - (message "Testing :regex matching") - (should (registry--match :regex entry '((hello "nye" "bye")))) - (should (registry--match :regex entry '((hello "good")))) - (should-not (registry--match :regex entry '((hello "nye")))) - (should-not (registry--match :regex entry '((hello)))) - - (message "Testing :member matching") - (should (registry--match :member entry '((hello "bye")))) - (should (registry--match :member entry '((hello "goodbye")))) - (should-not (registry--match :member entry '((hello "good")))) - (should-not (registry--match :member entry '((hello "nye")))) - (should-not (registry--match :member entry '((hello))))) - (message "Done with matching testing.")) - -(defun registry-make-testable-db (n &optional name file) - (let* ((db (registry-db - (or name "Testing") - :file (or file "unused") - :max-hard n - :max-soft 0 ; keep nothing not precious - :precious '(extra more-extra) - :tracked '(sender subject groups)))) - (dotimes (i n) - (registry-insert db i `((sender "me") - (subject "about you") - (more-extra) ; empty data key should be pruned - ;; first 5 entries will NOT have this extra data - ,@(when (< 5 i) (list (list 'extra "more data"))) - (groups ,(number-to-string i))))) - db)) - (provide 'registry) ;;; registry.el ends here