[gnus git] branch tzz-gnus-registry-rewrite updated: n0-15-38-g036b6ab =1= Demonstrate pre-lexbind bug through registry.el ERT tests.
Lars Magne Ingebrigtsen <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via 036b6abe2a3748edcae4607dc16e4dbfdef09ddc (commit)
from 98c0e74e50e3e428605c31fe7c238b8db2a5fcae (commit)
- Log -----------------------------------------------------------------
commit 036b6abe2a3748edcae4607dc16e4dbfdef09ddc
Author: Ted Zlatanov <[email protected]>
Date: Tue Apr 5 11:08:51 2011 -0500
Demonstrate pre-lexbind bug through registry.el ERT tests.
* (registry-lookup-breaks-before-lexbind): New method to demonstrate
pre-lexbind merge bug.
(registry-usage-test): Use it.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f790f53..114c20e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,9 @@
* registry.el (registry-db, initialize-instance): Set up constructor
instead of :initform arguments for the sake of older Emacsen.
+ (registry-lookup-breaks-before-lexbind): New method to demonstrate
+ pre-lexbind merge bug.
+ (registry-usage-test): Use it.
* gnus-registry.el (gnus-registry-fixup-registry): New function to
fixup the parameters that can be customized by the user between
diff --git a/lisp/registry.el b/lisp/registry.el
index ef78fec..6933725 100644
--- a/lisp/registry.el
+++ b/lisp/registry.el
@@ -147,6 +147,15 @@ Returns a alist of the key followed by the entry in a list, not a cons cell."
(list k (gethash k data))))
keys))))
+(defmethod registry-lookup-breaks-before-lexbind ((db registry-db) keys)
+ "Search for KEYS in the registry-db THIS.
+Returns a alist of the key followed by the entry in a list, not a cons cell."
+ (let ((data (oref db :data)))
+ (delq nil
+ (loop for key in keys
+ when (gethash key data)
+ collect (list key (gethash key data))))))
+
(defmethod registry-lookup-secondary ((db registry-db) tracksym
&optional create)
"Search for TRACKSYM in the registry-db THIS.
@@ -345,6 +354,12 @@ 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)))))
(message "Search")
(should (= n (length (registry-search db :all t))))
(should (= n (length (registry-search db :member '((sender "me"))))))
-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.
Summary of changes:
lisp/ChangeLog | 3 +++
lisp/registry.el | 15 +++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".
The branch, tzz-gnus-registry-rewrite has been updated
hooks/post-receive
--
Gnus Project