Removed nil extension from Predicate protocol and added com.google.common.base.Predicate extension.

This commit is contained in:
Mattias Holmqvist 2011-05-03 00:09:12 +02:00
parent 6708106626
commit 4191df74a8
2 changed files with 5 additions and 2 deletions

View File

@ -28,5 +28,5 @@
(reify com.google.common.base.Predicate
(apply [this input] (p input))))
nil
(to-predicate [_] nil))
com.google.common.base.Predicate
(to-predicate [p] p))

View File

@ -62,6 +62,9 @@ list, Alan Dipert and MeikelBrandmeyer."
(is (= 1 (count (nodes *compute*))))
(is (= 1 (count (nodes-in-group *compute* "fred"))))
(is (= 1 (count (nodes-with-details-matching *compute* (in-group "fred")))))
(is (= 1 (count (nodes-with-details-matching *compute*
(reify com.google.common.base.Predicate
(apply [this input] (= (.getGroup input) "fred")))))))
(is (= 0 (count (nodes-with-details-matching *compute* (in-group "othergroup")))))
(suspend-nodes-matching *compute* (in-group "fred"))
(is (suspended? (first (nodes-with-details-matching *compute* (in-group "fred")))))