[Zodb-checkins] CVS: Zope/lib/python/BTrees/tests - testSetOps.py:1.6

Tim Peters tim.one@comcast.net
Sun, 23 Jun 2002 15:36:13 -0400


Update of /cvs-repository/Zope/lib/python/BTrees/tests
In directory cvs.zope.org:/tmp/cvs-serv17896/tests

Modified Files:
	testSetOps.py 
Log Message:
The set operation difference(X, None) was returning None instead of
returning X, contradicting the docs and common sense.
difference(None, X) continues to return None. 


=== Zope/lib/python/BTrees/tests/testSetOps.py 1.5 => 1.6 ===
             self.assert_(C is None)
 
-        for op in self.union, self.intersection:
+        for op in self.union, self.intersection, self.difference:
             for A in self.As:
                 C = op(A, None)
                 self.assert_(C is A)
 
                 C = op(None, A)
-                self.assert_(C is A)
-
-        # XXX These difference results contradict the docs.  The implementation
-        # XXX is almost certainly wrong, but can we change it?
-        for A in self.As:
-            C = self.difference(A, None)
-            self.assert_(C is None)
-
-            C = self.difference(None, A)
-            self.assert_(C is None)
+                if op is self.difference:
+                    self.assert_(C is None)
+                else:
+                    self.assert_(C is A)
 
     def testEmptyUnion(self):
         for A in self.As: