X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=lisp%2Fregistry.el;h=3c402cb361ac513c8201001ef313f3bd00e4ed16;hp=edaa4f54f5fbb74a9be95f8bb892d428fac007b8;hb=854af5310dde4fed6a522a59d1d7816190f42142;hpb=3921b6be350597edd0d796deefc5174850da768f diff --git a/lisp/registry.el b/lisp/registry.el index edaa4f54f..3c402cb36 100644 --- a/lisp/registry.el +++ b/lisp/registry.el @@ -78,10 +78,11 @@ ;;; Code: (eval-when-compile - (when (null (require 'ert nil t)) + (when (null (ignore-errors (require 'ert))) (defmacro* ert-deftest (name () &body docstring-keys-and-body)))) -(require 'ert nil t) +(ignore-errors + (require 'ert)) (eval-when-compile (require 'cl)) (eval-and-compile @@ -130,7 +131,7 @@ :type hash-table :documentation "The data hashtable."))) -(defmethod initialize-instance :after ((this registry-db) slots) +(defmethod initialize-instance :AFTER ((this registry-db) slots) "Set value of data slot of THIS after initialization." (with-slots (data tracker) this (unless (member :data slots) @@ -356,12 +357,13 @@ Removes only entries without the :precious keys." (should (= 58 (caadr (registry-lookup db '(1 58 99))))) (message "Grouped individual lookup") (should (= 3 (length (registry-lookup db '(1 58 99))))) - (message "Individual lookup (breaks before lexbind)") - (should (= 58 - (caadr (registry-lookup-breaks-before-lexbind db '(1 58 99))))) - (message "Grouped individual lookup (breaks before lexbind)") - (should (= 3 - (length (registry-lookup-breaks-before-lexbind db '(1 58 99))))) + (when (boundp 'lexical-binding) + (message "Individual lookup (breaks before lexbind)") + (should (= 58 + (caadr (registry-lookup-breaks-before-lexbind db '(1 58 99))))) + (message "Grouped individual lookup (breaks before lexbind)") + (should (= 3 + (length (registry-lookup-breaks-before-lexbind db '(1 58 99)))))) (message "Search") (should (= n (length (registry-search db :all t)))) (should (= n (length (registry-search db :member '((sender "me"))))))