[gnus git] branch master updated: m0-1-151-g81eb9ad =1= More registry test adjustments.

Ted Zlatanov <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  81eb9adf99deb3c7e9d517c3d4723a90fdafb2ed (commit)
      from  c1079f4741f9f8ee36a254d5867f3d4b3bc01c4b (commit)


- Log -----------------------------------------------------------------
commit 81eb9adf99deb3c7e9d517c3d4723a90fdafb2ed
Author: Ted Zlatanov <[email protected]>
Date:   Tue Feb 14 14:48:03 2012 -0500

    More registry test adjustments.
    
    * registry.el (registry-make-testable-db, registry-match-test)
    (registry-instantiation-test): Move to tests/gnustest-registry.el.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 37c5a42..5f5d0a9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,8 @@
 
 	* registry.el (registry-usage-test, registry-persistence-test): Move to
 	tests/gnustest-registry.el.
+	(registry-make-testable-db, registry-match-test)
+	(registry-instantiation-test): Move to tests/gnustest-registry.el.
 
 	* gnus-registry.el (gnus-registry-misc-test)
 	(gnus-registry-usage-test): Move to tests/gnustest-registry.el.
diff --git a/lisp/registry.el b/lisp/registry.el
index 8079195..b2130d5 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
diff --git a/lisp/tests/gnustest-registry.el b/lisp/tests/gnustest-registry.el
index fb822ad..512fab4 100644
--- a/lisp/tests/gnustest-registry.el
+++ b/lisp/tests/gnustest-registry.el
@@ -34,9 +34,46 @@
 (require 'registry)
 (require 'gnus-registry)
 
+(ert-deftest gnustest-registry-instantiation-test ()
+  (should (registry-db "Testing")))
+
+(ert-deftest gnustest-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 gnustest-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))
+
 (ert-deftest gnustest-registry-usage-test ()
   (let* ((n 100)
-         (db (registry-make-testable-db n)))
+         (db (gnustest-registry-make-testable-db n)))
     (message "size %d" n)
     (should (= n (registry-size db)))
     (message "max-hard test")
@@ -81,7 +118,7 @@
   (let* ((n 100)
          (tempfile (make-temp-file "registry-persistence-"))
          (name "persistence tester")
-         (db (registry-make-testable-db n name tempfile))
+         (db (gnustest-registry-make-testable-db n name tempfile))
          size back)
     (message "Saving to %s" tempfile)
     (eieio-persistent-save db)

-----------------------------------------------------------------------
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                  |    2 +
 lisp/registry.el                |   37 -----------------------------------
 lisp/tests/gnustest-registry.el |   41 +++++++++++++++++++++++++++++++++++++-
 3 files changed, 41 insertions(+), 39 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, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.