Avoid failing tests for Emacs without lexical binding.
authorDavid Engster <dengste@eml.cc>
Thu, 7 Apr 2011 18:47:29 +0000 (20:47 +0200)
committerDavid Engster <dengste@eml.cc>
Thu, 7 Apr 2011 18:47:29 +0000 (20:47 +0200)
* registry.el (registry-usage-test): Only do
`registry-lookup-breaks-before-lexbind' testing for Emacs24 with
lexical binding.

lisp/ChangeLog
lisp/registry.el

index 447675c..ff1b3b7 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-07  David Engster  <dengste@eml.cc>
+
+       * registry.el (registry-usage-test): Only do
+       `registry-lookup-breaks-before-lexbind' testing for Emacs24 with
+       lexical binding.
+
 2011-04-07  David Engster  <dengste@eml.cc>
 
        * Makefile.in (check, test-registry): New rules for test-suite.
 2011-04-07  David Engster  <dengste@eml.cc>
 
        * Makefile.in (check, test-registry): New rules for test-suite.
index 8fb7aab..3c402cb 100644 (file)
@@ -357,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)))))
     (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"))))))
     (message "Search")
     (should (= n (length (registry-search db :all t))))
     (should (= n (length (registry-search db :member '((sender "me"))))))